From 6bfe9b8749c9a41b3d37816879bb0fac1fdd60d5 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 2 Oct 2018 12:12:39 +0100 Subject: [CI] Support building source images with in-review changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following this change it is possible to add 'Depends-On' lines to a kolla commit message that point to reviews in other projects. For example, this could be used to test building and deploying container images containing a change to the nova project that is currently in review. It also allows to introduce jobs testing against Kolla in other projects. The kolla-build-config Ansible role can also be used by other projects, such as kolla-ansible, to generate the necessary configuration. This takes us closer to the Kolla Builder - Next Generation concept [1]. [1] http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014255.html Change-Id: Ia2efa6b5d7278b75ab8dec23207f92d6bd7c58f0 Co-Authored-By: Radosław Piliszek --- tests/playbooks/run.yml | 29 +++++++++++++++++++++++++---- tests/templates/kolla-build.conf.j2 | 18 ------------------ 2 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 tests/templates/kolla-build.conf.j2 (limited to 'tests') diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml index a7fa66126..d1da0c9f4 100644 --- a/tests/playbooks/run.yml +++ b/tests/playbooks/run.yml @@ -2,6 +2,18 @@ - hosts: all vars_files: - ../vars/zuul.yml + vars: + tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}" + kolla_build_config: + DEFAULT: + debug: true + logs_dir: "{{ kolla_build_logs_dir }}" + base: "{{ base_distro }}" + install_type: "{{ install_type }}" + template_override: /etc/kolla/template_overrides.j2 + # NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon + # and since we don't need isolated networks here, use host networking + network_mode: host tasks: - name: Ensure /etc/kolla exists file: @@ -10,10 +22,19 @@ mode: 0777 become: true - - name: Template kolla-build.conf - template: - src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/kolla-build.conf.j2" - dest: /etc/kolla/kolla-build.conf + - name: Add publisher config + vars: + kolla_publisher_config: + DEFAULT: + namespace: kolla + tag: "{{ (zuul.tag if zuul.pipeline == 'release' else zuul.branch | basename) ~ tag_suffix }}" + set_fact: + kolla_build_config: "{{ kolla_build_config | combine(kolla_publisher_config, recursive=True) }}" + when: + - publisher + + - import_role: + name: kolla-build-config - name: Template template_overrides.j2 template: diff --git a/tests/templates/kolla-build.conf.j2 b/tests/templates/kolla-build.conf.j2 deleted file mode 100644 index cb1c18499..000000000 --- a/tests/templates/kolla-build.conf.j2 +++ /dev/null @@ -1,18 +0,0 @@ -[DEFAULT] -debug = true -{% if publisher %} -namespace = kolla -{% set tag_suffix = '-aarch64' if ansible_architecture == 'aarch64' else '' %} -tag = {{ (zuul.tag if zuul.pipeline == "release" else zuul.branch | basename) ~ tag_suffix }} -{% endif %} -base = {{ base_distro }} -{% if base_tag is defined %} -base_tag = {{ base_tag }} -{% endif %} -install_type = {{ install_type }} -push = false -logs_dir = {{ kolla_build_logs_dir }} -template_override = /etc/kolla/template_overrides.j2 -# NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon -# and since we don't need isolated networks here, use host networking -network_mode = host -- cgit v1.2.3