Fix docker image builds

The credentials secret needs to be associated with the playbook
that uses it.

Also, add build-image-jinja-init to check, this was accidentally
omitted earlier.

Change-Id: I527a26781a716f9307539e4a486d6b79b32f25fd
This commit is contained in:
James E. Blair 2019-01-11 09:35:12 -08:00
parent c132c0fe25
commit b4471fb2b6
3 changed files with 50 additions and 26 deletions

View File

@ -63,16 +63,45 @@
uploaded (it will be tagged with this in the local
registry).
abstract: true
pre-run: playbooks/zuul/build-image/pre.yaml
run: playbooks/zuul/build-image/run.yaml
- job:
name: system-config-upload-image
parent: system-config-build-image
description: |
Build and upload a docker image.
.. zuul:jobvar:: images
A list of images to build. Each item in the list should have:
.. zuul:jobvar:: context
The docker build context; should be a directory in this repo.
.. zuul:jobvar:: target
Optional; if supplied, the target for a multi-stage build.
.. zuul:jobvar:: repository
The name of the target repository in dockerhub for the
image. Supply this even if the image is not going to be
uploaded (it will be tagged with this in the local
registry).
.. zuul:jobvar:: credentials
If this is provided, the resulting image will be uploaded.
This should be a secret with two keys: ``username`` and
``password``.
abstract: true
pre-run: playbooks/zuul/build-image/pre.yaml
run: playbooks/zuul/build-image/run.yaml
post-run: playbooks/zuul/build-image/upload.yaml
secrets:
name: credentials
secret: system-config-dockerhub
- job:
name: system-config-promote-image
@ -97,6 +126,9 @@
abstract: true
run: playbooks/zuul/build-image/promote.yaml
secrets:
name: credentials
secret: system-config-dockerhub
nodeset:
nodes: []
@ -104,8 +136,8 @@
name: system-config-build-image-gitea
description: Build a gitea image
parent: system-config-build-image
vars:
images: &gitea_images
vars: &gitea_vars
images:
- context: docker/gitea
target: gitea
repository: opendevorg/gitea
@ -118,28 +150,23 @@
- job:
name: system-config-upload-image-gitea
description: Build and upload a gitea image
parent: system-config-build-image-gitea
secrets:
name: credentials
secret: system-config-dockerhub
parent: system-config-upload-image
vars: *gitea_vars
files: *gitea_files
- job:
name: system-config-promote-image-gitea
description: Promote a previously published gitea image to latest
parent: system-config-promote-image
secrets:
name: credentials
secret: system-config-dockerhub
vars:
images: *gitea_images
vars: *gitea_vars
files: *gitea_files
- job:
name: system-config-build-image-jinja-init
description: Build a jinja-init image
parent: system-config-build-image
vars:
images: &jinja-init_images
vars: &jinja-init_vars
images:
- context: docker/jinja-init
target: jinja-init
repository: opendevorg/jinja-init
@ -149,20 +176,15 @@
- job:
name: system-config-upload-image-jinja-init
description: Build and upload a jinja-init image
parent: system-config-build-image-jinja-init
secrets:
name: credentials
secret: system-config-dockerhub
parent: system-config-upload-image
vars: *jinja-init_vars
files: *jinja-init_files
- job:
name: system-config-promote-image-jinja-init
description: Promote a previously published jinja-init image to latest
parent: system-config-promote-image
secrets:
name: credentials
secret: system-config-dockerhub
vars:
images: *jinja-init_images
vars: *jinja-init_vars
files: *jinja-init_files
# Role integration jobs. These test the top-level generic roles/*
@ -448,6 +470,7 @@
- system-config-run-nodepool
- system-config-run-docker
- system-config-build-image-gitea
- system-config-build-image-jinja-init
gate:
jobs:
- tox-linters

View File

@ -112,4 +112,4 @@ EXPOSE 22
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/usr/sbin/sshd", "-D"]
# this comment is here to perform a test run of the job.
# this comment is here to perform a test run of the job..

View File

@ -32,3 +32,4 @@ RUN pip install jinja2
COPY --from=build /src/jinja-init/run.py /
ENTRYPOINT ["python", "/run.py"]
# this comment is here to perform a test run of the job.