From b5699278ebd2d86a934f4504e14cb42f17411c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20C=2E=20R=C3=ADos?= Date: Mon, 17 Jan 2022 11:54:18 +0100 Subject: [PATCH] Future proofing main with the tag split Adding the split now so we can just bump a number in the future --- ci/pipeline.yml | 18 +++++++++--------- ci/pr-pipeline.yml | 4 ++-- ci/tasks/acceptance-tests.yml | 2 +- ci/tasks/build-project.yml | 2 +- ci/tasks/promote.yml | 2 +- ci/tasks/stage.yml | 2 +- ci/tasks/sync-to-maven-central.yml | 2 +- scripts/set-pipelines.sh | 11 +++++++---- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 9e8da63..b52976d 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -68,7 +68,7 @@ jobs: - task: acceptance-tests file: git-repo/ci/tasks/acceptance-tests.yml vars: - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) on_success: in_parallel: - *slack-success-notification @@ -89,7 +89,7 @@ jobs: file: git-repo/ci/tasks/stage.yml vars: release-type: M - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - put: artifactory-repo params: <<: *artifactory-params @@ -107,7 +107,7 @@ jobs: file: git-repo/ci/tasks/stage.yml vars: release-type: RC - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - put: artifactory-repo params: <<: *artifactory-params @@ -125,7 +125,7 @@ jobs: file: git-repo/ci/tasks/stage.yml vars: release-type: RELEASE - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - put: artifactory-repo params: <<: *artifactory-params @@ -146,7 +146,7 @@ jobs: file: git-repo/ci/tasks/promote.yml vars: release-type: M - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - name: promote-rc serial: true @@ -161,7 +161,7 @@ jobs: file: git-repo/ci/tasks/promote.yml vars: release-type: RC - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - name: promote-release serial: true @@ -176,7 +176,7 @@ jobs: file: git-repo/ci/tasks/promote.yml vars: release-type: RELEASE - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - name: sync-to-maven-central serial: true @@ -190,7 +190,7 @@ jobs: - task: sync-to-maven-central file: git-repo/ci/tasks/sync-to-maven-central.yml vars: - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) resource_types: - name: artifactory-resource @@ -256,7 +256,7 @@ resources: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) - name: artifactory-repo type: artifactory-resource diff --git a/ci/pr-pipeline.yml b/ci/pr-pipeline.yml index fb4d7ad..f51d5d9 100644 --- a/ci/pr-pipeline.yml +++ b/ci/pr-pipeline.yml @@ -27,7 +27,7 @@ jobs: input_mapping: git-repo: pull-request vars: - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) - name: run-acceptance-tests serial: true plan: @@ -42,7 +42,7 @@ jobs: - task: acceptance-tests file: pull-request/ci/tasks/acceptance-tests.yml vars: - branch: ((branch)) + ci-image-tag: ((ci-image-tag)) input_mapping: git-repo: pull-request on_success: diff --git a/ci/tasks/acceptance-tests.yml b/ci/tasks/acceptance-tests.yml index 0aa23ff..0e0ff24 100644 --- a/ci/tasks/acceptance-tests.yml +++ b/ci/tasks/acceptance-tests.yml @@ -6,7 +6,7 @@ image_resource: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) inputs: - name: git-repo - name: toolsmith-env diff --git a/ci/tasks/build-project.yml b/ci/tasks/build-project.yml index 3006c39..b68058a 100644 --- a/ci/tasks/build-project.yml +++ b/ci/tasks/build-project.yml @@ -6,7 +6,7 @@ image_resource: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) inputs: - name: git-repo outputs: diff --git a/ci/tasks/promote.yml b/ci/tasks/promote.yml index fa2d884..4744e09 100644 --- a/ci/tasks/promote.yml +++ b/ci/tasks/promote.yml @@ -6,7 +6,7 @@ image_resource: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) inputs: - name: git-repo - name: artifactory-repo diff --git a/ci/tasks/stage.yml b/ci/tasks/stage.yml index 7a4f85f..e9a3b8b 100644 --- a/ci/tasks/stage.yml +++ b/ci/tasks/stage.yml @@ -6,7 +6,7 @@ image_resource: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) inputs: - name: git-repo outputs: diff --git a/ci/tasks/sync-to-maven-central.yml b/ci/tasks/sync-to-maven-central.yml index 2418641..0a8bad6 100644 --- a/ci/tasks/sync-to-maven-central.yml +++ b/ci/tasks/sync-to-maven-central.yml @@ -6,7 +6,7 @@ image_resource: repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci username: ((corporate-harbor-robot-account.username)) password: ((corporate-harbor-robot-account.password)) - tag: ((branch)) + tag: ((ci-image-tag)) inputs: - name: git-repo - name: artifactory-repo diff --git a/scripts/set-pipelines.sh b/scripts/set-pipelines.sh index 06aa909..2714fea 100755 --- a/scripts/set-pipelines.sh +++ b/scripts/set-pipelines.sh @@ -5,19 +5,22 @@ set -euo pipefail readonly FLY_TARGET="app-broker" readonly VERSION=1.5.x readonly BRANCH=main +readonly CI_IMAGE_TAG=main set_pipeline() { - local pipeline_name pipeline_definition branch + local pipeline_name pipeline_definition branch ci_image_tag pipeline_name="${1:?pipeline name must be provided}" pipeline_definition="${2:?pipeline definition file must be provided}" branch="${3:?branch must be provided}" + ci_image_tag="${4:?ci_image_tag must be provided}" echo "Setting $pipeline_name pipeline..." fly --target "$FLY_TARGET" set-pipeline \ --pipeline "$pipeline_name" \ --config "$pipeline_definition" \ --load-vars-from config-concourse.yml \ - --var "branch=$branch" + --var "branch=$branch" \ + --var "ci-image-tag=$ci_image_tag" } main() { @@ -25,8 +28,8 @@ main() { pushd "$(dirname "$0")/../ci" >/dev/null - set_pipeline "app-broker-$VERSION" pipeline.yml "$BRANCH" - set_pipeline "app-broker-$VERSION-pr" pr-pipeline.yml "$BRANCH" + set_pipeline "app-broker-$VERSION" pipeline.yml "$BRANCH" "$CI_IMAGE_TAG" + set_pipeline "app-broker-$VERSION-pr" pr-pipeline.yml "$BRANCH" "$CI_IMAGE_TAG" popd >/dev/null }