Skip to content

Commit 2a3d2c7

Browse files
committed
Splitting image tag from branch
1 parent 6ce4b6e commit 2a3d2c7

File tree

7 files changed

+22
-19
lines changed

7 files changed

+22
-19
lines changed

ci/pipeline.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
timeout: 1h30m
3939
file: git-repo/ci/tasks/build-project.yml
4040
vars:
41-
branch: ((branch))
41+
ci-image-tag: ((ci-image-tag))
4242
- put: artifactory-repo
4343
params: &artifactory-params
4444
signing_key: ((signing-key))
@@ -68,7 +68,7 @@ jobs:
6868
- task: acceptance-tests
6969
file: git-repo/ci/tasks/acceptance-tests.yml
7070
vars:
71-
branch: ((branch))
71+
ci-image-tag: ((ci-image-tag))
7272
on_success:
7373
in_parallel:
7474
- *slack-success-notification
@@ -89,7 +89,7 @@ jobs:
8989
file: git-repo/ci/tasks/stage.yml
9090
vars:
9191
release-type: M
92-
branch: ((branch))
92+
ci-image-tag: ((ci-image-tag))
9393
- put: artifactory-repo
9494
params:
9595
<<: *artifactory-params
@@ -107,7 +107,7 @@ jobs:
107107
file: git-repo/ci/tasks/stage.yml
108108
vars:
109109
release-type: RC
110-
branch: ((branch))
110+
ci-image-tag: ((ci-image-tag))
111111
- put: artifactory-repo
112112
params:
113113
<<: *artifactory-params
@@ -125,7 +125,7 @@ jobs:
125125
file: git-repo/ci/tasks/stage.yml
126126
vars:
127127
release-type: RELEASE
128-
branch: ((branch))
128+
ci-image-tag: ((ci-image-tag))
129129
- put: artifactory-repo
130130
params:
131131
<<: *artifactory-params
@@ -146,7 +146,7 @@ jobs:
146146
file: git-repo/ci/tasks/promote.yml
147147
vars:
148148
release-type: M
149-
branch: ((branch))
149+
ci-image-tag: ((ci-image-tag))
150150

151151
- name: promote-rc
152152
serial: true
@@ -161,7 +161,7 @@ jobs:
161161
file: git-repo/ci/tasks/promote.yml
162162
vars:
163163
release-type: RC
164-
branch: ((branch))
164+
ci-image-tag: ((ci-image-tag))
165165

166166
- name: promote-release
167167
serial: true
@@ -176,7 +176,7 @@ jobs:
176176
file: git-repo/ci/tasks/promote.yml
177177
vars:
178178
release-type: RELEASE
179-
branch: ((branch))
179+
ci-image-tag: ((ci-image-tag))
180180

181181
- name: sync-to-maven-central
182182
serial: true
@@ -190,7 +190,7 @@ jobs:
190190
- task: sync-to-maven-central
191191
file: git-repo/ci/tasks/sync-to-maven-central.yml
192192
vars:
193-
branch: ((branch))
193+
ci-image-tag: ((ci-image-tag))
194194

195195
resource_types:
196196
- name: artifactory-resource
@@ -256,7 +256,7 @@ resources:
256256
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
257257
username: ((corporate-harbor-robot-account.username))
258258
password: ((corporate-harbor-robot-account.password))
259-
tag: ((branch))
259+
tag: ((ci-image-tag))
260260

261261
- name: artifactory-repo
262262
type: artifactory-resource

ci/tasks/acceptance-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image_resource:
66
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
77
username: ((corporate-harbor-robot-account.username))
88
password: ((corporate-harbor-robot-account.password))
9-
tag: ((branch))
9+
tag: ((ci-image-tag))
1010
inputs:
1111
- name: git-repo
1212
- name: toolsmith-env

ci/tasks/build-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image_resource:
66
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
77
username: ((corporate-harbor-robot-account.username))
88
password: ((corporate-harbor-robot-account.password))
9-
tag: ((branch))
9+
tag: ((ci-image-tag))
1010
inputs:
1111
- name: git-repo
1212
outputs:

ci/tasks/promote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image_resource:
66
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
77
username: ((corporate-harbor-robot-account.username))
88
password: ((corporate-harbor-robot-account.password))
9-
tag: ((branch))
9+
tag: ((ci-image-tag))
1010
inputs:
1111
- name: git-repo
1212
- name: artifactory-repo

ci/tasks/stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image_resource:
66
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
77
username: ((corporate-harbor-robot-account.username))
88
password: ((corporate-harbor-robot-account.password))
9-
tag: ((branch))
9+
tag: ((ci-image-tag))
1010
inputs:
1111
- name: git-repo
1212
outputs:

ci/tasks/sync-to-maven-central.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image_resource:
66
repository: ((corporate-harbor-registry))/((dockerhub-organization))/app-broker-ci
77
username: ((corporate-harbor-robot-account.username))
88
password: ((corporate-harbor-robot-account.password))
9-
tag: ((branch))
9+
tag: ((ci-image-tag))
1010
inputs:
1111
- name: git-repo
1212
- name: artifactory-repo

scripts/set-pipelines.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,31 @@ set -euo pipefail
55
readonly FLY_TARGET="app-broker"
66
readonly VERSION=1.4.x
77
readonly BRANCH=1.4.x
8+
readonly CI_IMAGE_TAG=main
89

910
set_pipeline() {
10-
local pipeline_name pipeline_definition branch
11+
local pipeline_name pipeline_definition branch ci_image_tag
1112
pipeline_name="${1:?pipeline name must be provided}"
1213
pipeline_definition="${2:?pipeline definition file must be provided}"
1314
branch="${3:?branch must be provided}"
15+
ci_image_tag="${4:?ci_image_tag must be provided}"
1416

1517
echo "Setting $pipeline_name pipeline..."
1618
fly --target "$FLY_TARGET" set-pipeline \
1719
--pipeline "$pipeline_name" \
1820
--config "$pipeline_definition" \
1921
--load-vars-from config-concourse.yml \
20-
--var "branch=$branch"
22+
--var "branch=$branch" \
23+
--var "ci-image-tag=$ci_image_tag"
2124
}
2225

2326
main() {
2427
fly -t app-broker sync
2528

2629
pushd "$(dirname "$0")/../ci" >/dev/null
2730

28-
set_pipeline "app-broker-$VERSION" pipeline.yml "$BRANCH"
29-
set_pipeline "app-broker-$VERSION-pr" pr-pipeline.yml "$BRANCH"
31+
set_pipeline "app-broker-$VERSION" pipeline.yml "$BRANCH" "$CI_IMAGE_TAG"
32+
set_pipeline "app-broker-$VERSION-pr" pr-pipeline.yml "$BRANCH" "$CI_IMAGE_TAG"
3033

3134
popd >/dev/null
3235
}

0 commit comments

Comments
 (0)