diff --git a/Makefile b/Makefile index 1ab423f..cc48cf9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TOPTGTS := images lint all docs run_images tests +TOPTGTS := images lint all docs run_images tests clean IMAGES := $(wildcard */Makefile) $(TOPTGTS): $(IMAGES) diff --git a/ipa-downloader-image/Makefile b/ipa-downloader-image/Makefile index 8e2adcc..245d2cd 100644 --- a/ipa-downloader-image/Makefile +++ b/ipa-downloader-image/Makefile @@ -90,4 +90,8 @@ images: build_ipa tests: echo TODO -.PHONY: images build_ipa tests +clean: + docker image rm $(IMAGE) + # TODO: Clean up ipa builder container/image/artifacts + +.PHONY: images build_ipa tests clean diff --git a/playbooks/airship-images-build.yaml b/playbooks/airship-images-build.yaml index d6a058a..0963973 100644 --- a/playbooks/airship-images-build.yaml +++ b/playbooks/airship-images-build.yaml @@ -38,21 +38,21 @@ when: pre_build_role is defined - name: Publish images block: - - make: + - command: make images clean + args: chdir: "{{ makefile_chdir }}" - target: "images" - params: - AZ_SDK: "{{ az_sdk }}" - COMMIT: "{{ zuul.newrev | default('') }}" - DOCKER_REGISTRY: "{{ docker_registry }}" - GCP_SDK: "{{ gcp_sdk }}" - 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') }}" + environment: + AZ_SDK: "{{ az_sdk }}" + COMMIT: "{{ zuul.newrev | default('') }}" + DOCKER_REGISTRY: "{{ docker_registry }}" + GCP_SDK: "{{ gcp_sdk }}" + 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 f71146b..b706560 100644 --- a/playbooks/airship-images-publish.yaml +++ b/playbooks/airship-images-publish.yaml @@ -44,23 +44,23 @@ password: "{{ airship_images_quay_creds.password }}" registry_url: "{{ docker_registry }}" - name: Push Images with Latest and Commit Tags - make: + command: make images clean + args: chdir: "{{ makefile_chdir }}" - target: "images" - params: - AZ_SDK: "{{ az_sdk }}" - COMMIT: "{{ zuul.newrev | default('') }}" - DOCKER_REGISTRY: "{{ docker_registry }}" - GCP_SDK: "{{ gcp_sdk }}" - IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" - IMAGE_TAG: "{{ item }}" - 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') }}" + environment: + AZ_SDK: "{{ az_sdk }}" + COMMIT: "{{ zuul.newrev | default('') }}" + DOCKER_REGISTRY: "{{ docker_registry }}" + GCP_SDK: "{{ gcp_sdk }}" + IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" + IMAGE_TAG: "{{ item }}" + 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') }}" with_items: - "{{ image_tag | default('latest') }}" - "{{ zuul.newrev }}"