Allow proxy and container repository customization
Modify airship-images-publish playbook and makefiles to add proxy variables to run the post job on internal zuul setup Change-Id: I3a5e55c9a64a0d7bef5f0f252f00b28a072c2fa1
This commit is contained in:
parent
3b351b1aa1
commit
91fc0d5017
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 \
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user