From 2b7a9dc20766d4b61503535ec9508663f13ff28d Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Sun, 14 Apr 2019 11:23:33 +0100 Subject: [PATCH] Fix periodic CI jobs Periodic jobs don't have zuul.change defined, since there is no change being tested. This causes an early failure when referencing zuul.change to set the image tag for built images. In periodic jobs we'll never need to build images because there is no dependent kolla change under test. Change-Id: I6d9d81cf17b7d0d7aaf87cd96418c904c46681f2 --- tests/run.yml | 3 ++- tests/templates/globals-default.j2 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/run.yml b/tests/run.yml index 53c31933c0..1938391654 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -18,6 +18,7 @@ kolla_ansible_src_dir: "{{ ansible_env.PWD }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible" kolla_ansible_local_src_dir: "{{ zuul.executor.work_root }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible" need_build_image: false + build_image_tag: "change_{{ zuul.change | default('none') }}" tasks: # FIXME: in multi node env, api_interface may be different on each node. - name: detect api_interface_name variable @@ -141,7 +142,7 @@ BASE_DISTRO: "{{ base_distro }}" INSTALL_TYPE: "{{ install_type }}" BUILD_IMAGE: "{{ need_build_image }}" - TAG: "change_{{ zuul.change }}" + TAG: "{{ build_image_tag }}" KOLLA_SRC_DIR: "{{ ansible_env.HOME }}/src/git.openstack.org/openstack/kolla" ACTION: "{{ scenario }}" diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 5a2a3c753d..60908a780b 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -23,7 +23,7 @@ openstack_service_workers: "1" # NOTE(Jeffrey4l): use different a docker namespace name in case it pull image from hub.docker.io when deplying docker_namespace: "lokolla" docker_registry: "{{ api_interface_address }}:4000" -openstack_release: "change_{{ zuul.change }}" +openstack_release: "{{ build_image_tag }}" {% else %} # use docker hub images docker_namespace: "kolla"