From e3058f546a7f451563f7a0c1728e49d097fcf1df Mon Sep 17 00:00:00 2001 From: "Anderson, Craig (ca846m)" Date: Tue, 23 Feb 2021 12:31:39 -0800 Subject: [PATCH] Enable additional makefile values to be overridden Change-Id: I10d5b5ab65be4210593d5caaedf28a86ddfac824 --- .zuul.yaml | 3 +++ ironic/Makefile | 5 ++++- ironic/build-image.sh | 4 +++- playbooks/airship-images-build.yaml | 15 +++++++++------ playbooks/airship-images-publish.yaml | 15 +++++++++------ 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 352bfe1..514992d 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -22,6 +22,9 @@ noproxy: "" makefile_chdir: "{{ zuul.project.src_dir }}" image_config_dir: config + image_prefix: airshipit + image_label: org.airshipit.build=community + image_tag: latest check: jobs: - airship-images-functional diff --git a/ironic/Makefile b/ironic/Makefile index 8e519ed..2b890af 100644 --- a/ironic/Makefile +++ b/ironic/Makefile @@ -24,7 +24,10 @@ OPENSTACK_VERSION ?= stable/ussuri DISTRO ?= ubuntu_bionic OS_VER = $(word 2, $(subst /, ,$(OPENSTACK_VERSION))) IMAGE_NAME ?= ironic -IMAGE_TAG ?= ${OS_VER}-${DISTRO} +# Maintain support for legacy behavior +ifeq ($(IMAGE_TAG), latest) +IMAGE_TAG := ${OS_VER}-${DISTRO} +endif IMAGE_IRONIC := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} IMAGE_REQUIREMENTS := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/requirements:${IMAGE_TAG} IMAGE_LOCI_WHEELS := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/loci_wheels:${IMAGE_TAG} diff --git a/ironic/build-image.sh b/ironic/build-image.sh index d98babb..64be9e9 100755 --- a/ironic/build-image.sh +++ b/ironic/build-image.sh @@ -21,7 +21,9 @@ set -e : "${ironic_pip_packages:="pycrypto python-openstackclient sushy"}" : "${ironic_dist_packages:="ethtool lshw iproute2"}" # Image tag -IMAGE_TAG="${OPENSTACK_VERSION#*/}-${DISTRO}" +if [ -z "${IMAGE_TAG}" ]; then + IMAGE_TAG="${OPENSTACK_VERSION#*/}-${DISTRO}" +fi echo "Build Pre-Requirement docker image" docker build ${base_extra_build_args} \ diff --git a/playbooks/airship-images-build.yaml b/playbooks/airship-images-build.yaml index 9ff9b9c..1a831a0 100644 --- a/playbooks/airship-images-build.yaml +++ b/playbooks/airship-images-build.yaml @@ -38,14 +38,17 @@ chdir: "{{ makefile_chdir }}" target: "images" params: + AZ_SDK: "{{ az_sdk }}" COMMIT: "{{ zuul.newrev | default('') }}" - PUSH_IMAGE: "false" - PROXY: "{{ proxy.http }}" - NO_PROXY: "{{ proxy.noproxy }}" - USE_PROXY: "{{ proxy.enabled | lower }}" DOCKER_REGISTRY: "{{ docker_registry }}" GCP_SDK: "{{ gcp_sdk }}" - AZ_SDK: "{{ az_sdk }}" - WORKDIR: "{{ image_config_dir | default('config') }}" + IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" + IMAGE_TAG: "{{ image_tag | default('latest') }}" + LABEL: "{{ image_label | default('org.airshipit.build=community') }}" + NO_PROXY: "{{ proxy.noproxy }}" + PUSH_IMAGE: "false" + PROXY: "{{ proxy.http }}" QCOW_CONF_DIRS: "{{ qcow_conf_dirs | default('') }}" + USE_PROXY: "{{ proxy.enabled | lower }}" + WORKDIR: "{{ image_config_dir | default('config') }}" become: True diff --git a/playbooks/airship-images-publish.yaml b/playbooks/airship-images-publish.yaml index 9f50928..d10ff42 100644 --- a/playbooks/airship-images-publish.yaml +++ b/playbooks/airship-images-publish.yaml @@ -42,14 +42,17 @@ chdir: "{{ makefile_chdir }}" target: "images" params: + AZ_SDK: "{{ az_sdk }}" COMMIT: "{{ zuul.newrev | default('') }}" - PUSH_IMAGE: "true" - PROXY: "{{ proxy.http }}" - NO_PROXY: "{{ proxy.noproxy }}" - USE_PROXY: "{{ proxy.enabled | lower }}" DOCKER_REGISTRY: "{{ docker_registry }}" GCP_SDK: "{{ gcp_sdk }}" - AZ_SDK: "{{ az_sdk }}" - WORKDIR: "{{ image_config_dir | default('config') }}" + IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" + IMAGE_TAG: "{{ image_tag | default('latest') }}" + LABEL: "{{ image_label | default('org.airshipit.build=community') }}" + NO_PROXY: "{{ proxy.noproxy }}" + PUSH_IMAGE: "true" + PROXY: "{{ proxy.http }}" QCOW_CONF_DIRS: "{{ qcow_conf_dirs | default('') }}" + USE_PROXY: "{{ proxy.enabled | lower }}" + WORKDIR: "{{ image_config_dir | default('config') }}" become: True