diff --git a/.zuul.yaml b/.zuul.yaml index 89fd26e..733f754 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -11,6 +11,13 @@ # limitations under the License. - project: + vars: + docker_registry: https://quay.io/api/v1/ + proxy: + enabled: false + http: "" + https: "" + noproxy: "" check: jobs: - airship-images-functional diff --git a/bootstrap_capg/Makefile b/bootstrap_capg/Makefile index 181e5e2..da3f620 100644 --- a/bootstrap_capg/Makefile +++ b/bootstrap_capg/Makefile @@ -16,6 +16,9 @@ DOCKER_IMAGE_PREFIX ?= airshipit DOCKER_IMAGE_TAG ?= latest DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) DOCKER_TARGET_STAGE ?= release +PROXY ?= http://proxy.foo.com:8000 +NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local +USE_PROXY ?= false PATH += :/usr/local/go/bin HELP_FILE ?= /tmp/help.txt @@ -31,10 +34,23 @@ images: Dockerfile \ config/gcp_cluster.go \ config/gcp_config.go \ assets/help.txt +ifeq ($(USE_PROXY), true) + @docker build . --network=host \ + --build-arg MAKE_TARGET=$(DOCKER_MAKE_TARGET) \ + --tag $(DOCKER_IMAGE) \ + --build-arg http_proxy=$(PROXY) \ + --build-arg https_proxy=$(PROXY) \ + --build-arg HTTP_PROXY=$(PROXY) \ + --build-arg HTTPS_PROXY=$(PROXY) \ + --build-arg no_proxy=$(NO_PROXY) \ + --build-arg NO_PROXY=$(NO_PROXY) \ + --force-rm=$(DOCKER_FORCE_CLEAN) +else @docker build . --network=host \ --build-arg MAKE_TARGET=$(DOCKER_MAKE_TARGET) \ --tag $(DOCKER_IMAGE) \ --force-rm=$(DOCKER_FORCE_CLEAN) +endif ifeq ($(PUSH_IMAGE), true) docker push $(DOCKER_IMAGE) endif diff --git a/bootstrap_capz/Makefile b/bootstrap_capz/Makefile index 5e5548e..b0dcf07 100644 --- a/bootstrap_capz/Makefile +++ b/bootstrap_capz/Makefile @@ -16,6 +16,9 @@ DOCKER_IMAGE_PREFIX ?= airshipit DOCKER_IMAGE_TAG ?= latest DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) DOCKER_TARGET_STAGE ?= release +PROXY ?= http://proxy.foo.com:8000 +NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local +USE_PROXY ?= false PATH += :/usr/local/go/bin HELP_FILE ?= /tmp/help.txt @@ -31,10 +34,23 @@ images: Dockerfile \ config/aks_cluster.go \ config/azure_config.go \ assets/help.txt +ifeq ($(USE_PROXY), true) + @docker build . --network=host \ + --build-arg MAKE_TARGET=$(DOCKER_MAKE_TARGET) \ + --tag $(DOCKER_IMAGE) \ + --build-arg http_proxy=$(PROXY) \ + --build-arg https_proxy=$(PROXY) \ + --build-arg HTTP_PROXY=$(PROXY) \ + --build-arg HTTPS_PROXY=$(PROXY) \ + --build-arg no_proxy=$(NO_PROXY) \ + --build-arg NO_PROXY=$(NO_PROXY) \ + --force-rm=$(DOCKER_FORCE_CLEAN) +else @docker build . --network=host \ --build-arg MAKE_TARGET=$(DOCKER_MAKE_TARGET) \ --tag $(DOCKER_IMAGE) \ --force-rm=$(DOCKER_FORCE_CLEAN) +endif ifeq ($(PUSH_IMAGE), true) docker push $(DOCKER_IMAGE) endif diff --git a/ironic/Makefile b/ironic/Makefile index dad7e0d..8e519ed 100644 --- a/ironic/Makefile +++ b/ironic/Makefile @@ -56,6 +56,9 @@ build_requirements: mkdir -p $(BUILD_DIR) ifeq ($(IMAGE_ID), none) ifeq ($(USE_PROXY), true) + http_proxy=$(PROXY) https_proxy=$(PROXY) \ + HTTP_PROXY=$(PROXY) HTTPS_PROXY=$(PROXY) \ + no_proxy=$(NO_PROXY) NO_PROXY=$(NO_PROXY) \ docker build --force-rm --pull --no-cache \ https://git.openstack.org/openstack/loci.git \ --network host \ @@ -143,6 +146,9 @@ build_ironic: mkdir -p $(BUILD_DIR) ifeq ($(IMAGE_ID), none) ifeq ($(USE_PROXY), true) + http_proxy=$(PROXY) https_proxy=$(PROXY) \ + HTTP_PROXY=$(PROXY) HTTPS_PROXY=$(PROXY) \ + no_proxy=$(NO_PROXY) NO_PROXY=$(NO_PROXY) \ docker build --force-rm --pull --no-cache \ https://git.openstack.org/openstack/loci.git \ --network host \ diff --git a/playbooks/airship-images-publish.yaml b/playbooks/airship-images-publish.yaml index 80c384f..491e4d3 100644 --- a/playbooks/airship-images-publish.yaml +++ b/playbooks/airship-images-publish.yaml @@ -30,11 +30,15 @@ - docker_login: username: "{{ airship_images_quay_creds.username }}" password: "{{ airship_images_quay_creds.password }}" - registry_url: "https://quay.io/api/v1/" + registry_url: "{{ docker_registry }}" - make: chdir: "{{ zuul.project.src_dir }}" target: "images" params: COMMIT: "{{ zuul.newrev | default('') }}" PUSH_IMAGE: "true" + PROXY: "{{ proxy.http }}" + NO_PROXY: "{{ proxy.noproxy }}" + USE_PROXY: "{{ proxy.enabled | lower }}" + DOCKER_REGISTRY: "{{ docker_registry }}" become: True