From 89d92077617ea5c5286df583d8c604b9b675f160 Mon Sep 17 00:00:00 2001 From: Brandon Pfeifer Date: Tue, 18 Oct 2022 12:21:47 -0400 Subject: [PATCH] chore: update to use scheduled pipeline (2.x) (#23811) * chore: update to use scheduled pipeline * chore: add documentation to scheduled pipelines --- .circleci/config.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 739b3f2fc50..5cd30667a0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,10 @@ parameters: type: string default: go1.18.6-9c97f2f2903566a00bd4b00184aeca0c813adda0 + workflow: + type: string + default: build + executors: cross-builder: docker: @@ -64,6 +68,8 @@ nofork_filter: &nofork_filter workflows: version: 2 build: + when: + equal: [ << pipeline.parameters.workflow >>, build ] jobs: - test-race: <<: *any_filter @@ -200,13 +206,17 @@ workflows: - aws-destroy-by-date nightly: - triggers: - - schedule: - cron: "0 5 * * *" - filters: - branches: - only: - - master + when: + and: + # This requires a pipeline trigger with a custom "workflow" parameter + # set to "nightly". Since we want to trigger this workflow on several + # branches, we cannot use the trigger name as suggested by the + # documentation. + # + # For more information: + # https://circleci.com/docs/scheduled-pipelines/ + - equal: [ << pipeline.trigger_source >>, scheduled_pipeline ] + - equal: [ << pipeline.parameters.workflow >>, nightly ] jobs: - changelog - s3-publish-changelog: