Merge "Refactor docker/container image jobs"
This commit is contained in:
commit
e4ac244bd8
@ -1,7 +0,0 @@
|
|||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
upload_container_image_promote: true
|
|
||||||
upload_docker_image_promote: true
|
|
||||||
tasks:
|
|
||||||
- name: Include build tasks
|
|
||||||
include_tasks: test-build-container-image-inner.yaml
|
|
@ -1,7 +0,0 @@
|
|||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
upload_container_image_promote: false
|
|
||||||
upload_docker_image_promote: false
|
|
||||||
tasks:
|
|
||||||
- name: Include build tasks
|
|
||||||
include_tasks: test-build-container-image-inner.yaml
|
|
@ -1,5 +1,5 @@
|
|||||||
- name: Set image variables
|
- hosts: all
|
||||||
set_fact:
|
vars:
|
||||||
_arch_docker_images:
|
_arch_docker_images:
|
||||||
- context: test-playbooks/container/docker
|
- context: test-playbooks/container/docker
|
||||||
repository: "testrepo"
|
repository: "testrepo"
|
||||||
@ -24,50 +24,50 @@
|
|||||||
repository: 127.0.0.1:5200/testrepo
|
repository: 127.0.0.1:5200/testrepo
|
||||||
# This is what the Zuul repo uses to tag its releases:
|
# This is what the Zuul repo uses to tag its releases:
|
||||||
tags: "{{ zuul.tag is defined | ternary([zuul.get('tag', '').split('.')[0], '.'.join(zuul.get('tag', '').split('.')[:2]), zuul.get('tag', '')], ['latest']) }}"
|
tags: "{{ zuul.tag is defined | ternary([zuul.get('tag', '').split('.')[0], '.'.join(zuul.get('tag', '').split('.')[:2]), zuul.get('tag', '')], ['latest']) }}"
|
||||||
|
tasks:
|
||||||
|
- name: Set docker_images variable
|
||||||
|
when: "roleset == 'docker'"
|
||||||
|
set_fact:
|
||||||
|
docker_images: "{{ multiarch | ternary(_arch_docker_images, _normal_docker_images) }}"
|
||||||
|
|
||||||
- name: Set docker_images variable
|
- name: Set container_images variable
|
||||||
when: "container_command == 'docker'"
|
when: "roleset == 'container'"
|
||||||
set_fact:
|
set_fact:
|
||||||
docker_images: "{{ multiarch | ternary(_arch_docker_images, _normal_docker_images) }}"
|
container_images: "{{ multiarch | ternary(_arch_container_images, _normal_container_images) }}"
|
||||||
|
|
||||||
- name: Set container_images variable
|
- name: Save zuul variables
|
||||||
when: "container_command != 'docker'"
|
set_fact:
|
||||||
set_fact:
|
old_zuul: "{{ zuul }}"
|
||||||
container_images: "{{ multiarch | ternary(_arch_container_images, _normal_container_images) }}"
|
|
||||||
|
|
||||||
- name: Save zuul variables
|
- name: Set simulated zuul variables
|
||||||
set_fact:
|
set_fact:
|
||||||
old_zuul: "{{ zuul }}"
|
new_zuul:
|
||||||
|
pipeline: "{{ old_zuul.pipeline }}"
|
||||||
|
change_url: "{{ old_zuul.change_url }}"
|
||||||
|
executor: "{{ old_zuul.executor }}"
|
||||||
|
newrev: c12f3fe1defe8b61d59061363c9c04fb520dae18
|
||||||
|
project: "{{ old_zuul.project }}"
|
||||||
|
ref: refs/tags/3.19.0
|
||||||
|
tag: 3.19.0
|
||||||
|
|
||||||
- name: Set simulated zuul variables
|
- name: "Build a container image"
|
||||||
set_fact:
|
include_role:
|
||||||
new_zuul:
|
name: "build-{{ roleset }}-image"
|
||||||
pipeline: "{{ old_zuul.pipeline }}"
|
vars:
|
||||||
change_url: "{{ old_zuul.change_url }}"
|
zuul: "{{ new_zuul }}"
|
||||||
executor: "{{ old_zuul.executor }}"
|
|
||||||
newrev: c12f3fe1defe8b61d59061363c9c04fb520dae18
|
|
||||||
project: "{{ old_zuul.project }}"
|
|
||||||
ref: refs/tags/3.19.0
|
|
||||||
tag: 3.19.0
|
|
||||||
|
|
||||||
- name: "Build a container image"
|
- name: "Upload container image"
|
||||||
include_role:
|
include_role:
|
||||||
name: "build-{{ (container_command == 'docker') | ternary('docker', 'container') }}-image"
|
name: "upload-{{ roleset }}-image"
|
||||||
vars:
|
vars:
|
||||||
zuul: "{{ new_zuul }}"
|
zuul: "{{ new_zuul }}"
|
||||||
|
|
||||||
- name: "Upload container image"
|
- name: "Upload container image"
|
||||||
include_role:
|
when: "promote"
|
||||||
name: "upload-{{ (container_command == 'docker') | ternary('docker', 'container') }}-image"
|
include_role:
|
||||||
vars:
|
name: "upload-{{ roleset }}-image"
|
||||||
zuul: "{{ new_zuul }}"
|
vars:
|
||||||
|
zuul: "{{ new_zuul }}"
|
||||||
|
|
||||||
- name: "Upload container image"
|
- name: "Show local container images for debugging"
|
||||||
when: "upload_container_image_promote or upload_docker_image_promote"
|
command: "{{ container_command }} image ls"
|
||||||
include_role:
|
|
||||||
name: "upload-{{ (container_command == 'docker') | ternary('docker', 'container') }}-image"
|
|
||||||
vars:
|
|
||||||
zuul: "{{ new_zuul }}"
|
|
||||||
|
|
||||||
- name: "Show local container images for debugging"
|
|
||||||
command: "{{ container_command }} image ls"
|
|
@ -12,7 +12,6 @@
|
|||||||
- centos-platforms
|
- centos-platforms
|
||||||
- fedora-platforms
|
- fedora-platforms
|
||||||
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-ensure-docker-centos-7
|
name: zuul-jobs-test-ensure-docker-centos-7
|
||||||
description: Tests ensure-docker role on centos-7
|
description: Tests ensure-docker role on centos-7
|
||||||
@ -104,95 +103,123 @@
|
|||||||
label: ubuntu-jammy
|
label: ubuntu-jammy
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-build-container-image-release
|
name: zuul-jobs-test-build-docker-or-container-image-base
|
||||||
|
abstract: true
|
||||||
description: |
|
description: |
|
||||||
Test building a container image in a release pipeline.
|
A parent job for both docker and container image building jobs.
|
||||||
|
|
||||||
This job tests changes to the build-container-image role,
|
|
||||||
simulating its use within a tag-based release pipeline. It is
|
|
||||||
not meant to be used directly but rather run on changes to roles
|
|
||||||
in the zuul-jobs repo.
|
|
||||||
files:
|
files:
|
||||||
- roles/ensure-podman/.*
|
|
||||||
- roles/ensure-package-repositories/.*
|
- roles/ensure-package-repositories/.*
|
||||||
- roles/build-container-image/.*
|
|
||||||
- roles/upload-container-image/.*
|
|
||||||
- test-playbooks/container/.*
|
- test-playbooks/container/.*
|
||||||
pre-run: test-playbooks/container/test-build-container-image-pre.yaml
|
|
||||||
run: test-playbooks/container/test-build-container-image-release.yaml
|
|
||||||
vars:
|
|
||||||
container_command: podman
|
|
||||||
multiarch: false
|
|
||||||
nodeset:
|
nodeset:
|
||||||
nodes:
|
nodes:
|
||||||
- name: builder
|
- name: builder
|
||||||
label: ubuntu-jammy
|
label: ubuntu-jammy
|
||||||
|
pre-run: test-playbooks/container/test-build-container-image-pre.yaml
|
||||||
|
run: test-playbooks/container/test-build-container-image.yaml
|
||||||
|
|
||||||
|
|
||||||
|
# The following jobs are focused on the "container" roles:
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-build-container-image-promote
|
name: zuul-jobs-test-build-container-image-base
|
||||||
|
parent: zuul-jobs-test-build-docker-or-container-image-base
|
||||||
|
abstract: true
|
||||||
description: |
|
description: |
|
||||||
Test building a container image in gate and promote pipelines.
|
A parent for container image building jobs.
|
||||||
|
|
||||||
This job tests changes to the build-container-image role,
|
|
||||||
simulating its use within a tag-based release pipeline. It is
|
|
||||||
not meant to be used directly but rather run on changes to roles
|
|
||||||
in the zuul-jobs repo.
|
|
||||||
files:
|
files:
|
||||||
- roles/ensure-podman/.*
|
|
||||||
- roles/ensure-skopeo/.*
|
|
||||||
- roles/ensure-package-repositories/.*
|
|
||||||
- roles/build-container-image/.*
|
- roles/build-container-image/.*
|
||||||
- roles/upload-container-image/.*
|
- roles/upload-container-image/.*
|
||||||
- roles/promote-container-image/.*
|
|
||||||
- test-playbooks/container/.*
|
|
||||||
pre-run: test-playbooks/container/test-build-container-image-pre.yaml
|
|
||||||
run: test-playbooks/container/test-build-container-image-promote.yaml
|
|
||||||
vars:
|
vars:
|
||||||
container_command: podman
|
promote: false
|
||||||
|
roleset: container
|
||||||
multiarch: false
|
multiarch: false
|
||||||
nodeset:
|
|
||||||
nodes:
|
|
||||||
- name: builder
|
|
||||||
label: ubuntu-jammy
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-build-docker-image-release
|
name: zuul-jobs-test-build-container-image-docker-release
|
||||||
|
parent: zuul-jobs-test-build-container-image-base
|
||||||
description: |
|
description: |
|
||||||
Test building a docker image in a release pipeline.
|
Test building a container image with docker in a release pipeline.
|
||||||
|
files:
|
||||||
This job tests changes to the build-docker-image role,
|
- roles/ensure-docker/.*
|
||||||
simulating its use within a tag-based release pipeline. It is
|
vars:
|
||||||
not meant to be used directly but rather run on changes to roles
|
container_command: docker
|
||||||
in the zuul-jobs repo.
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-build-container-image-podman-release
|
||||||
|
parent: zuul-jobs-test-build-container-image-base
|
||||||
|
description: |
|
||||||
|
Test building a container image with podman in a release pipeline.
|
||||||
|
files:
|
||||||
|
- roles/ensure-podman/.*
|
||||||
|
vars:
|
||||||
|
container_command: podman
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-build-container-image-promote-base
|
||||||
|
parent: zuul-jobs-test-build-container-image-base
|
||||||
|
abstract: true
|
||||||
|
description: |
|
||||||
|
Test building a container image in gate and promote pipelines.
|
||||||
|
files:
|
||||||
|
- roles/ensure-skopeo/.*
|
||||||
|
- roles/promote-container-image/.*
|
||||||
|
vars:
|
||||||
|
promote: true
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-build-container-image-docker-promote
|
||||||
|
parent: zuul-jobs-test-build-container-image-promote-base
|
||||||
|
description: |
|
||||||
|
Test building a container image with docker in a promote pipeline.
|
||||||
|
files:
|
||||||
|
- roles/ensure-docker/.*
|
||||||
|
vars:
|
||||||
|
container_command: docker
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-build-container-image-podman-promote
|
||||||
|
parent: zuul-jobs-test-build-container-image-promote-base
|
||||||
|
description: |
|
||||||
|
Test building a container image with podman in a promote pipeline.
|
||||||
|
files:
|
||||||
|
- roles/ensure-podman/.*
|
||||||
|
vars:
|
||||||
|
container_command: podman
|
||||||
|
|
||||||
|
# The following jobs are focused on the "docker" roles:
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-build-docker-image-base
|
||||||
|
parent: zuul-jobs-test-build-docker-or-container-image-base
|
||||||
|
abstract: true
|
||||||
|
description: |
|
||||||
|
A parent for docker image building jobs.
|
||||||
files:
|
files:
|
||||||
- roles/ensure-docker/.*
|
- roles/ensure-docker/.*
|
||||||
- roles/ensure-package-repositories/.*
|
|
||||||
- roles/build-docker-image/.*
|
- roles/build-docker-image/.*
|
||||||
- roles/upload-docker-image/.*
|
- roles/upload-docker-image/.*
|
||||||
- test-playbooks/container/.*
|
|
||||||
pre-run: test-playbooks/container/test-build-container-image-pre.yaml
|
|
||||||
run: test-playbooks/container/test-build-container-image-release.yaml
|
|
||||||
vars:
|
vars:
|
||||||
container_command: docker
|
container_command: docker
|
||||||
multiarch: false
|
multiarch: false
|
||||||
nodeset:
|
promote: false
|
||||||
nodes:
|
roleset: docker
|
||||||
- name: builder
|
|
||||||
label: ubuntu-jammy
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-build-docker-image-release-multiarch
|
name: zuul-jobs-test-build-docker-image-release
|
||||||
parent: zuul-jobs-test-build-docker-image-release
|
parent: zuul-jobs-test-build-docker-image-base
|
||||||
description: |
|
description: |
|
||||||
Test building a docker image in a release pipeline.
|
Test building a docker image in a release pipeline.
|
||||||
|
|
||||||
This job tests changes to the build-docker-image role using buildx,
|
- job:
|
||||||
simulating its use within a tag-based release pipeline. It is
|
name: zuul-jobs-test-build-docker-image-release-multiarch
|
||||||
not meant to be used directly but rather run on changes to roles
|
parent: zuul-jobs-test-build-docker-image-base
|
||||||
in the zuul-jobs repo.
|
description: |
|
||||||
|
Test building a docker image in a release pipeline.
|
||||||
vars:
|
vars:
|
||||||
multiarch: true
|
multiarch: true
|
||||||
|
|
||||||
|
# End container building job tests
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-registry-docker
|
name: zuul-jobs-test-registry-docker
|
||||||
description: |
|
description: |
|
||||||
@ -597,8 +624,10 @@
|
|||||||
- zuul-jobs-test-ensure-docker-ubuntu-bionic
|
- zuul-jobs-test-ensure-docker-ubuntu-bionic
|
||||||
- zuul-jobs-test-ensure-docker-ubuntu-focal
|
- zuul-jobs-test-ensure-docker-ubuntu-focal
|
||||||
- zuul-jobs-test-ensure-docker-ubuntu-jammy
|
- zuul-jobs-test-ensure-docker-ubuntu-jammy
|
||||||
- zuul-jobs-test-build-container-image-release
|
- zuul-jobs-test-build-container-image-docker-release
|
||||||
- zuul-jobs-test-build-container-image-promote
|
- zuul-jobs-test-build-container-image-podman-release
|
||||||
|
- zuul-jobs-test-build-container-image-docker-promote
|
||||||
|
- zuul-jobs-test-build-container-image-podman-promote
|
||||||
- zuul-jobs-test-build-docker-image-release
|
- zuul-jobs-test-build-docker-image-release
|
||||||
- zuul-jobs-test-build-docker-image-release-multiarch
|
- zuul-jobs-test-build-docker-image-release-multiarch
|
||||||
- zuul-jobs-test-registry-docker
|
- zuul-jobs-test-registry-docker
|
||||||
@ -631,8 +660,10 @@
|
|||||||
- zuul-jobs-test-ensure-docker-ubuntu-bionic
|
- zuul-jobs-test-ensure-docker-ubuntu-bionic
|
||||||
- zuul-jobs-test-ensure-docker-ubuntu-focal
|
- zuul-jobs-test-ensure-docker-ubuntu-focal
|
||||||
- zuul-jobs-test-ensure-docker-ubuntu-jammy
|
- zuul-jobs-test-ensure-docker-ubuntu-jammy
|
||||||
- zuul-jobs-test-build-container-image-release
|
- zuul-jobs-test-build-container-image-docker-release
|
||||||
- zuul-jobs-test-build-container-image-promote
|
- zuul-jobs-test-build-container-image-podman-release
|
||||||
|
- zuul-jobs-test-build-container-image-docker-promote
|
||||||
|
- zuul-jobs-test-build-container-image-podman-promote
|
||||||
- zuul-jobs-test-build-docker-image-release
|
- zuul-jobs-test-build-docker-image-release
|
||||||
- zuul-jobs-test-build-docker-image-release-multiarch
|
- zuul-jobs-test-build-docker-image-release-multiarch
|
||||||
- zuul-jobs-test-registry-docker
|
- zuul-jobs-test-registry-docker
|
||||||
|
Loading…
Reference in New Issue
Block a user