From a2fa087f3cb6a3e2aa7245651a502dd10afef64b Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Mon, 26 Oct 2020 23:09:47 -0400 Subject: [PATCH] zuul: add post-job to publish container images to quay.io With the coming rate limiting on docker hub, users might want to have an alternative to pull from. Change-Id: I35714fdd069165c9766371c83393aa431237ccec --- .zuul.d/jobs.yaml | 24 ++++++++++++++++--- .zuul.d/project.yaml | 1 + .zuul.d/secrets.yaml | 16 +++++++++++++ ...aml => zuul_publish_container_images.yaml} | 4 ++-- 4 files changed, 40 insertions(+), 5 deletions(-) rename tests/{zuul_publish_dockerhub.yaml => zuul_publish_container_images.yaml} (85%) diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index a00c4031..288423b6 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -166,10 +166,28 @@ nodeset: ara-fedora-32 description: | Builds ARA API container images with buildah and briefly tests them with podman. - The resulting images are pushed to dockerhub if successful. + The resulting images are pushed to docker.io/recordsansible/ara-api if successful. pre-run: tests/with_container_images.yaml - run: tests/zuul_publish_dockerhub.yaml + run: tests/zuul_publish_container_images.yaml + vars: + destination: docker.io/recordsansible/ara-api secrets: - - name: ara_dockerhub_credentials + - name: ara_registry_credentials secret: ara_dockerhub_credentials pass-to-parent: true + +- job: + name: ara-container-images-quayio + parent: ara-integration-base + nodeset: ara-fedora-32 + description: | + Builds ARA API container images with buildah and briefly tests them with podman. + The resulting images are pushed to quay.io/recordsansible/ara-api if successful. + pre-run: tests/with_container_images.yaml + run: tests/zuul_publish_container_images.yaml + vars: + destination: quay.io/recordsansible/ara-api + secrets: + - name: ara_registry_credentials + secret: ara_quayio_credentials + pass-to-parent: true diff --git a/.zuul.d/project.yaml b/.zuul.d/project.yaml index c107bebb..2b3021c9 100644 --- a/.zuul.d/project.yaml +++ b/.zuul.d/project.yaml @@ -32,3 +32,4 @@ - ara-upload-git-mirror - ara-demo - ara-container-images-dockerhub + - ara-container-images-quayio diff --git a/.zuul.d/secrets.yaml b/.zuul.d/secrets.yaml index ee6bff87..f2188f35 100644 --- a/.zuul.d/secrets.yaml +++ b/.zuul.d/secrets.yaml @@ -78,3 +78,19 @@ 7sEoMRIbBgd9zpAFy6Q0GdCKMLRZXhnOvfJx5W5qqbU4yDfmvsg4WQ+o8ed3vByTAhBzD V3mZ0qOM9e9S00S1dsTGR9Jfl0qVO5fZ8NrAKUmtdn8hDd/efXxjArTtHkVQs7HbF2Wp9 DD3Jn475bxwaB/RwY1NlSSQXgzmgAI2tt43H40kQkE9z/BG3U+owjhp3uIJu50= + +- secret: + name: ara_quayio_credentials + data: + username: "dmsimard+zuul_opendev_ara" + password: !encrypted/pkcs1-oaep + - pcvPnCuJWoyNJrX2//dZs+4u7/IGxUSAQcqLN372jIuKs4d0FCSPuyjQ+R3ZpfwRTIc/j + B9UKHFAYQIacy1xnflZFzEc5MtBQWLqgPgRUZ7foc5jSZn3BHxBbulJbtLgW5Rf9Xj8p9 + dK0VZpt3Q9HNv5gL8o3UX2Y6lNljxGMoIk2LDiIZA0aH6QtNPlUk4CLJyFcYfx1u8wzcK + 58eLJVYCFJUGJMy3wy2WdGGnPU3PEeBU7SCAwGeDV6nBBQVakeI1TrOoB+SuAFynEY/9Y + bMeGjjjs0g9nkRbzOJFwxdifSyPAQZAN8VZPF4KwTvclJBXrYltDhhwI36EFcV031H910 + mwq5qilS7hJfEfgEWQsi8h5e3Lj1cfcBOTahvdBIbG4KnY0Ig8RMLVMK7UJ5jtiQ+QZ30 + rM2U/C2QrHBcl/niD0sVVb0fFMkRzjmXbbxLbC/SAT4EO7eYGlvn+hNNadkIN7sffRaDJ + bItLd0lT0Zf310rUQw6GtVg/cwC5EMLRRWIF5yOA0bUI1fLKhbOGa98eoiAlKhuRXiqZU + efsnfiKD74ods1ue5lIcGtTcyplN8drJThUQgz4A1VC8OD9I5lWe39jV7ZH1RgSsoloTm + cpKBAI2MfXxIPRGQqznWc1FL1luKmMsqEMU6tpRDjIN1Uk5oRDvsvmIMpwzMGE= diff --git a/tests/zuul_publish_dockerhub.yaml b/tests/zuul_publish_container_images.yaml similarity index 85% rename from tests/zuul_publish_dockerhub.yaml rename to tests/zuul_publish_container_images.yaml index d89067d0..3cb123b0 100644 --- a/tests/zuul_publish_dockerhub.yaml +++ b/tests/zuul_publish_container_images.yaml @@ -42,11 +42,11 @@ - name: Push latest command: | - buildah push --creds {{ ara_dockerhub_credentials.username }}:{{ ara_dockerhub_credentials.password }} {{ destination }}:latest + buildah push --creds {{ ara_registry_credentials.username }}:{{ ara_registry_credentials.password }} {{ destination }}:latest no_log: yes - name: Push the remainder of the tags command: | - buildah push --creds {{ ara_dockerhub_credentials.username }}:{{ ara_dockerhub_credentials.password }} {{ destination }}:{{ item.tag }} + buildah push --creds {{ ara_registry_credentials.username }}:{{ ara_registry_credentials.password }} {{ destination }}:{{ item.tag }} no_log: yes loop: "{{ images }}"