
Add a job that tests the build-container-image role as it would be used in a tag-based release pipeline (as opposed to check or gate+promote). Also, correct an issue in the role where we assumed zuul.change existed. Change-Id: If2566764a52726ce45fff9b5e96ce9a42d513d8d
26 lines
1.0 KiB
YAML
26 lines
1.0 KiB
YAML
- hosts: all
|
|
tasks:
|
|
- name: Save zuul variables
|
|
set_fact:
|
|
old_zuul: "{{ zuul }}"
|
|
- name: Set simulated zuul variables
|
|
set_fact:
|
|
new_zuul:
|
|
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: "Build a container image"
|
|
include_role:
|
|
name: "build-{{ (container_command == 'docker') | ternary('docker', 'container') }}-image"
|
|
vars:
|
|
docker_images:
|
|
- context: test-playbooks/container/docker
|
|
repository: "testrepo"
|
|
# 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']) }}"
|
|
container_images: "{{ docker_images }}"
|
|
zuul: "{{ new_zuul }}"
|