Run upload-docker-image on release

When we tag a release of Nodepool, 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.

Apparently we also need to use python3 in this job now.  We were
already doing that for Zuul.  The default will be switching soon,
and we can remove that var entry then.

Change-Id: Id85bc3f56a9c18f1e6f4b14e6edefe76eabeff3e
This commit is contained in:
James E. Blair 2020-06-17 11:35:16 -07:00
parent 6e525c296a
commit db6a8944ee

View File

@ -167,18 +167,24 @@
- context: .
repository: zuul/nodepool
target: nodepool
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']) }}"
arch:
- linux/amd64
- linux/arm64
- context: .
repository: zuul/nodepool-launcher
target: nodepool-launcher
tags: *imagetag
arch:
- linux/amd64
- linux/arm64
- context: .
repository: zuul/nodepool-builder
target: nodepool-builder
tags: *imagetag
arch:
- linux/amd64
- linux/arm64
@ -364,7 +370,9 @@
- zuul-quick-start:
requires: zuul-container-image
dependencies: nodepool-build-image
- build-python-release
- build-python-release:
vars:
release_python: python3
gate:
jobs:
- nodepool-upload-image
@ -380,7 +388,9 @@
- zuul-quick-start:
requires: zuul-container-image
dependencies: nodepool-upload-image
- build-python-release
- build-python-release:
vars:
release_python: python3
promote:
jobs:
- nodepool-promote-image
@ -388,5 +398,13 @@
- opendev-promote-python
release:
jobs:
- opendev-release-python
- zuul-publish-tox-docs
# - opendev-release-python
# - zuul-publish-tox-docs
- upload-docker-image:
secrets:
name: docker_credentials
secret: nodepool-dockerhub
pass-to-parent: true
vars:
<<: *nodepool_image_vars
upload_docker_image_promote: false