6 Commits

Author SHA1 Message Date
Andrii Ostapenko
ef47a743b6
Add ability to use *-docker-image roles in periodic jobs
Use '{{ zuul.pipeline }}' tag prefix in *-docker-image instead of
'change_{{ zuul.change }}' one when zuul.change is not provided, that is
the case with periodic jobs. This allows to build, upload and promote images
using periodic jobs e.g:

- project:
    periodic:
      - project-buildset-registry

      - project-build-image1:
          dependencies:
            - name: project-buildset-registry
      - project-build-image2:
          dependencies:
            - name: project-buildset-registry

      # pulls from buildset registry and tests both images
      - project-test:
          dependencies:
            - name: project-build-image1
            - name: project-build-image2

      # pre-pulls images from buildset registry for fast build
      - project-upload-image1:
          dependencies:
            - name: project-test
      - project-upload-image2:
          dependencies:
            - name: project-test

      - project-promote:
          dependencies:
            - name: project-upload-image1
            - name: project-upload-image2

This fuctionality will allow to keep latest images up to date for the
case when image incorporates continuously updating code from multiple
repositories.

Using true ternary for tag evaluation because ternary filter requires
all passed to it variables be defined or defaulted [0].

[0] https://github.com/ansible/ansible/issues/51276

Change-Id: I8eb7d2baa24905e7aac51fce0b2f9b1f24f037f9
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
2020-09-25 14:22:17 -05:00
Albin Vass
06e35b2125 Test multiarch release builds and use temp registry with buildx
When using docker buildx to build a container image, use a temporary
registry to receive the built image instead of requiring a buildset
registry.

A multi-arch test is also added with a publication registry
using the same task list to reduce duplication.

Change-Id: Ib20d1c97f6cb63e0ff9d8888ea792d1941cd8690
Co-Authored-By: James E. Blair <jeblair@redhat.com>
2020-07-01 10:29:31 -07:00
Monty Taylor
64741aa73d Don't upload to the tag with buildx - only to the change tag
This is a copy/pasta error from pulling this logic over from build.
We need to upload to dockerhub but only to the change_ version
of the tag.

Change-Id: I19d1b326ad2c5b1cef846f47e667f3c3480582e7
2020-05-07 18:17:59 -05:00
Monty Taylor
bd1ee92542 Process siblings in upload-image push
Otherwise the context might be different and we might have to
rebuild, which would be silly. I mean, not like this isn't
silly already.

Change-Id: I3651390581ad1b4ae66ed336825f60284bd7c4ad
2020-05-07 17:01:35 -05:00
Monty Taylor
53118e79ea Actually include platform in the upload build
It's awesome, we used buildx to push to docker hub. What we forgot
to do is pass the arch argument.

Change-Id: I99025544f7a8aea651e9562041af859a38cddbfc
2020-05-07 16:57:50 -05:00
Monty Taylor
dfb3884440 Upload images to dockerhub with buildx when using buildx
If we build multi-arch images with buildx we also need to push to
dockerhub using buildx, because otherwise we're just pushing
the single-arch image we fetched back from the buildset registry
for the local cache.

Change-Id: If8b95a708e4f0d24e959317b803f5c9379a8b62b
2020-05-07 09:23:56 -05:00