Browse Source

Support overrides for internal Zuul setup

Change-Id: Idbf3ed41013d0d2109d96659803642b23a265082
changes/17/784117/18
Shturm, Svetlana 1 year ago
parent
commit
03868a46d8
  1. 11
      Makefile
  2. 2
      playbooks/airship-hostconfig-operator-build-images.yaml
  3. 2
      playbooks/airship-hostconfig-operator-publish-images.yaml
  4. 3
      roles/airship-gather-runtime-logs/tasks/main.yaml
  5. 10
      roles/hostconfig-operator-build-images/tasks/main.yaml
  6. 10
      roles/hostconfig-operator-publish-images/tasks/main.yaml
  7. 3
      zuul.d/jobs.yaml
  8. 9
      zuul.d/projects.yaml

11
Makefile

@ -12,7 +12,8 @@ DOCKER_IMAGE_TAG ?= latest
DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
# proxy options
PROXY ?= http://proxy.foo.com:8000
HTTP_PROXY ?= http://proxy.foo.com:8000
HTTPS_PROXY ?= http://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
@ -24,10 +25,10 @@ PUBLISH ?= false
images:
ifeq ($(USE_PROXY), true)
@docker build . --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 http_proxy=$(HTTP_PROXY) \
--build-arg https_proxy=$(HTTPS_PROXY) \
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg HTTPS_PROXY=$(HTTPS_PROXY) \
--build-arg no_proxy=$(NO_PROXY) \
--build-arg NO_PROXY=$(NO_PROXY) \
--force-rm=$(DOCKER_FORCE_CLEAN)

2
playbooks/airship-hostconfig-operator-build-images.yaml

@ -13,5 +13,5 @@
- hosts: all
become: yes
roles:
- role: ensure-docker
- role: docker-install
- hostconfig-operator-build-images

2
playbooks/airship-hostconfig-operator-publish-images.yaml

@ -13,5 +13,5 @@
- hosts: all
become: yes
roles:
- ensure-docker
- docker-install
- hostconfig-operator-publish-images

3
roles/airship-gather-runtime-logs/tasks/main.yaml

@ -43,3 +43,6 @@
src: "{{ runtime_logs_dir }}"
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
mode: pull
verify_host: true
owner: no
group: no

10
roles/hostconfig-operator-build-images/tasks/main.yaml

@ -14,8 +14,16 @@
make:
chdir: "{{ zuul.project.src_dir }}"
target: images
params:
DOCKER_REGISTRY: "{{ image_repo }}"
DOCKER_IMAGE_PREFIX: "{{ docker_image_prefix }}"
USE_PROXY: "{{ proxy.enabled | lower }}"
HTTP_PROXY: "{{ proxy.http }}"
HTTPS_PROXY: "{{ proxy.https }}"
DOCKER_IMAGE_TAG: "{{ zuul.change | default('latest') }}"
NO_PROXY: "{{ proxy.noproxy }}"
- name: Verify Image Exists
shell: docker image inspect "$(make print-docker-image-tag)"
shell: docker image inspect "$(make DOCKER_REGISTRY={{ image_repo }} DOCKER_IMAGE_PREFIX={{ docker_image_prefix }} DOCKER_IMAGE_TAG={{ zuul.change | default('latest') }} print-docker-image-tag)"
args:
chdir: "{{ zuul.project.src_dir }}"

10
roles/hostconfig-operator-publish-images/tasks/main.yaml

@ -32,8 +32,13 @@
make:
chdir: "{{ zuul.project.src_dir }}"
params:
USE_PROXY: "{{ proxy.enabled | lower }}"
HTTP_PROXY: "{{ proxy.http }}"
HTTPS_PROXY: "{{ proxy.https }}"
NO_PROXY: "{{ proxy.noproxy }}"
DOCKER_IMAGE_TAG: latest
DOCKER_REGISTRY: "{{ image_repo }}"
DOCKER_IMAGE_PREFIX: "{{ docker_image_prefix }}"
PUBLISH: "true"
target: images
@ -41,7 +46,12 @@
make:
chdir: "{{ zuul.project.src_dir }}"
params:
USE_PROXY: "{{ proxy.enabled | lower }}"
HTTP_PROXY: "{{ proxy.http }}"
HTTPS_PROXY: "{{ proxy.https }}"
NO_PROXY: "{{ proxy.noproxy }}"
DOCKER_IMAGE_TAG: "{{ zuul.newrev }}"
DOCKER_REGISTRY: "{{ image_repo }}"
DOCKER_IMAGE_PREFIX: "{{ docker_image_prefix }}"
PUBLISH: "true"
target: images

3
zuul.d/jobs.yaml

@ -53,9 +53,6 @@
- name: hostconfig_operator_image_repo_credentials
secret: hostconfig_operator_image_repo_credentials
pass-to-parent: true
vars:
image: quay.io/airshipit/hostconfig-operator
image_repo: quay.io
- job:
name: airship-hostconfig-operator-upload-git-mirror

9
zuul.d/projects.yaml

@ -11,6 +11,15 @@
# limitations under the License.
- project:
vars:
proxy:
enabled: false
http: ""
https: ""
noproxy: ""
image_repo: quay.io
docker_image_prefix: airshipit
check:
jobs:
- airship-hostconfig-operator-test

Loading…
Cancel
Save