Run upload-docker-image on release

When we tag a release of Zuul, run the upload-docker-image job, but
tell it to do so in a non-promote mode.  This will cause it to
directly upload the images to Docker Hub with the final tags applied.
We want to do this in the release pipeline so that we get images
built with the correct version number based on the git tag.

When run in a pipeline with a tag attribute set, this will use all
three lengths of the version number (3.19.0, 3.19, 3) as tags instead
of the single 'latest' tag which is what is applied in the promote
pipeline.

This temporarily comments out the other release jobs so that we can
manually enqueue the most recent tag and retroactively build and
publish it to Docker Hub.  Once this works, we will re-enable those
two jobs.

Change-Id: If3bdbe4fac7e8ebf8b2bb087b578df7f860cbea4
Depends-On: https://review.opendev.org/734890
This commit is contained in:
James E. Blair 2020-06-10 11:20:21 -07:00
parent f6e4d30ea1
commit 856f038ff8
1 changed files with 19 additions and 2 deletions

View File

@ -139,21 +139,30 @@
- context: .
repository: zuul/zuul
target: zuul
tags:
# If zuul.tag is defined: [ '3', '3.19', '3.19.0' ]. Only works for 3-component tags.
# Otherwise: ['latest']
&imagetag "{{ zuul.tag is defined | ternary([zuul.get('tag', '').split('.')[0], '.'.join(zuul.get('tag', '').split('.')[:2]), zuul.get('tag', '')], ['latest']) }}"
- context: .
repository: zuul/zuul-executor
target: zuul-executor
tags: *imagetag
- context: .
repository: zuul/zuul-fingergw
target: zuul-fingergw
tags: *imagetag
- context: .
repository: zuul/zuul-merger
target: zuul-merger
tags: *imagetag
- context: .
repository: zuul/zuul-scheduler
target: zuul-scheduler
tags: *imagetag
- context: .
repository: zuul/zuul-web
target: zuul-web
tags: *imagetag
- job:
name: zuul-upload-image
@ -311,5 +320,13 @@
download_artifact_job: zuul-build-dashboard
release:
jobs:
- zuul-release-python
- zuul-publish-tox-docs
# - zuul-release-python
# - zuul-publish-tox-docs
- upload-docker-image:
secrets:
name: docker_credentials
secret: zuul-dockerhub
pass-to-parent: true
vars:
<<: *zuul_image_vars
upload_docker_image_promote: false