From 396a1602718437a6ff6f168b81f9590592a826fd Mon Sep 17 00:00:00 2001 From: Dinesh Garg Date: Fri, 30 Oct 2020 08:29:37 +0000 Subject: [PATCH] Allow proxy and container repository customization Modify following roles to accept the proxy and env variables from zuul jobs and project manifest so they can be overwritten to run them on downstream zuul - airshipctl-build-images - airshipctl-publish-images Change-Id: Ied06e60507f125c60ca7b9d47331e967fd69bf14 --- roles/airshipctl-build-images/tasks/main.yaml | 4 ++++ roles/airshipctl-publish-images/tasks/main.yaml | 8 ++++++++ zuul.d/jobs.yaml | 1 - zuul.d/projects.yaml | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/roles/airshipctl-build-images/tasks/main.yaml b/roles/airshipctl-build-images/tasks/main.yaml index 65b5b6a73..7e79308b5 100644 --- a/roles/airshipctl-build-images/tasks/main.yaml +++ b/roles/airshipctl-build-images/tasks/main.yaml @@ -14,6 +14,10 @@ make: chdir: "{{ zuul.project.src_dir }}" target: images + params: + PROXY: "{{ proxy.http }}" + NO_PROXY: "{{ proxy.noproxy }}" + USE_PROXY: "{{ proxy.enabled | lower }}" - name: Verify Image Exists shell: docker image inspect "$(make print-docker-image-tag)" diff --git a/roles/airshipctl-publish-images/tasks/main.yaml b/roles/airshipctl-publish-images/tasks/main.yaml index 7bd6565ce..dba60ddac 100644 --- a/roles/airshipctl-publish-images/tasks/main.yaml +++ b/roles/airshipctl-publish-images/tasks/main.yaml @@ -34,6 +34,10 @@ params: DOCKER_IMAGE_TAG: latest PUBLISH: "true" + PROXY: "{{ proxy.http }}" + NO_PROXY: "{{ proxy.noproxy }}" + USE_PROXY: "{{ proxy.enabled | lower }}" + DOCKER_REGISTRY: "{{ image_repo }}" target: images - name: Push Image with Commit Tag @@ -42,4 +46,8 @@ params: DOCKER_IMAGE_TAG: "{{ zuul.newrev }}" PUBLISH: "true" + PROXY: "{{ proxy.http }}" + NO_PROXY: "{{ proxy.noproxy }}" + USE_PROXY: "{{ proxy.enabled | lower }}" + DOCKER_REGISTRY: "{{ image_repo }}" target: images diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 150687b77..3881af482 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -198,4 +198,3 @@ pass-to-parent: true vars: image: quay.io/airshipit/airshipctl - image_repo: https://quay.io/api/v1/ diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 42a3f0317..239892f3e 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -13,6 +13,12 @@ - project: vars: sphinx_build_dir: docs/build + proxy: + enabled: false + http: "" + https: "" + noproxy: "" + image_repo: https://quay.io/api/v1/ check: jobs: - openstack-tox-docs: &docs