From 761bf9cb9c03313c2d378c7e08cda44468c05ac3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 14 Dec 2022 09:49:50 -0500 Subject: [PATCH] See if we can get a triggered image build too --- .circleci/config.yml | 72 ++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7e4f2563..446c6b3a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,8 +11,45 @@ # version: 2.1 +# A template that can be shared between the two different image-building +# workflows. +.images: &IMAGES + jobs: + # Every job that pushes a Docker image from Docker Hub needs to provide + # credentials. Use this first job to define a yaml anchor that can be + # used to supply a CircleCI job context which makes Docker Hub credentials + # available in the environment. + # + # Contexts are managed in the CircleCI web interface: + # + # https://app.circleci.com/settings/organization/github/tahoe-lafs/contexts + - "build-image-debian-10": &DOCKERHUB_CONTEXT + context: "dockerhub-auth" + - "build-image-debian-11": + <<: *DOCKERHUB_CONTEXT + - "build-image-ubuntu-18-04": + <<: *DOCKERHUB_CONTEXT + - "build-image-ubuntu-20-04": + <<: *DOCKERHUB_CONTEXT + - "build-image-fedora-35": + <<: *DOCKERHUB_CONTEXT + - "build-image-oraclelinux-8": + <<: *DOCKERHUB_CONTEXT + # Restore later as PyPy38 + #- "build-image-pypy27-buster": + # <<: *DOCKERHUB_CONTEXT + +parameters: + build-images: + default: false + type: "boolean" + run-tests: + default: true + type: "boolean" + workflows: ci: + when: "<< pipeline.parameters.run-tests >>" jobs: # Start with jobs testing various platforms. - "debian-10": @@ -64,7 +101,15 @@ workflows: - "docs": {} - images: + triggered-images: + <<: *IMAGES + + # Build as part of the workflow but only if requested. + when: "<< pipeline.parameters.build-images >>" + + scheduled-images: + <<: *IMAGES + # Build the Docker images used by the ci jobs. This makes the ci jobs # faster and takes various spurious failures out of the critical path. triggers: @@ -76,31 +121,6 @@ workflows: only: - "master" - jobs: - # Every job that pushes a Docker image from Docker Hub needs to provide - # credentials. Use this first job to define a yaml anchor that can be - # used to supply a CircleCI job context which makes Docker Hub - # credentials available in the environment. - # - # Contexts are managed in the CircleCI web interface: - # - # https://app.circleci.com/settings/organization/github/tahoe-lafs/contexts - - "build-image-debian-10": &DOCKERHUB_CONTEXT - context: "dockerhub-auth" - - "build-image-debian-11": - <<: *DOCKERHUB_CONTEXT - - "build-image-ubuntu-18-04": - <<: *DOCKERHUB_CONTEXT - - "build-image-ubuntu-20-04": - <<: *DOCKERHUB_CONTEXT - - "build-image-fedora-35": - <<: *DOCKERHUB_CONTEXT - - "build-image-oraclelinux-8": - <<: *DOCKERHUB_CONTEXT - # Restore later as PyPy38 - #- "build-image-pypy27-buster": - # <<: *DOCKERHUB_CONTEXT - jobs: dockerhub-auth-template: