As outlined in https://lists.opendev.org/archives/list/service-discuss@lists.opendev.org/thread/VTMDDVSPM5HRUYWAATNMZOILT5OE57VR/ the current structure of building all the charts into one directory is causing issues on the opendev infra due too many entries in one directory. Switch away from using a Makefile to using an Ansible role to build each chart and then use chart-testing to identify the charts that need to be rebuilt and lastly build them build put the output into a subdir matching the chart name. Change-Id: I61f11950ba381c7897eb6bfff05a508ca4db9f06 Signed-off-by: Doug Goldstein <cardoe@cardoe.com> Signed-off-by: Vladimir Kozhukalov <kozhukalov@gmail.com>
58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
---
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
- hosts: all
|
|
roles:
|
|
- ensure-helm
|
|
- ensure-chart-testing
|
|
|
|
tasks:
|
|
- name: Install reno
|
|
pip:
|
|
name: reno>=4.1.0
|
|
virtualenv: "{{ virtualenv }}"
|
|
virtualenv_command: python3 -m venv
|
|
|
|
- name: Get list of changed charts
|
|
shell: "ct list-changed --target-branch master --since {{ zuul.oldrev | default('HEAD~1') }} --chart-dirs . 2>/dev/null"
|
|
args:
|
|
chdir: "{{ zuul.project.src_dir }}"
|
|
register: changed_charts_output
|
|
changed_when: false
|
|
|
|
- name: Parse changed charts
|
|
set_fact:
|
|
changed_charts: "{{ changed_charts_output.stdout_lines }}"
|
|
|
|
- name: Display changed charts
|
|
debug:
|
|
msg: "Changed charts: {{ changed_charts }}"
|
|
|
|
- name: Build each changed chart
|
|
make:
|
|
chdir: "{{ zuul.project.src_dir }}"
|
|
target: "{{ item }}"
|
|
params:
|
|
PYTHON: "{{ virtualenv }}/bin/python"
|
|
BASE_VERSION: "{{ base_version }}"
|
|
loop: "{{ changed_charts }}"
|
|
when: changed_charts | length > 0
|
|
|
|
- name: Move chart packages to subdirectories
|
|
shell: |
|
|
mkdir -p {{ zuul.project.src_dir }}/{{ item }}
|
|
mv {{ zuul.project.src_dir }}/{{ item }}-*.tgz {{ zuul.project.src_dir }}/{{ item }}/
|
|
loop: "{{ changed_charts }}"
|
|
when: changed_charts | length > 0
|
|
...
|