File tree 3 files changed +50
-0
lines changed
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ jobs:
203
203
passed :
204
204
- bats-centos
205
205
- bats-ubuntu
206
+ - task : assert-version-aligns
207
+ file : bosh-linux-stemcell-builder/ci/tasks/assert-version-aligns.yml
206
208
- task : copy-artifacts
207
209
file : bosh-linux-stemcell-builder/ci/tasks/publish.yml
208
210
params :
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ export BASE=$( pwd)
6
+
7
+ semver=` cat ${BASE} /version/number`
8
+
9
+ pushd " ${BASE} /bosh-linux-stemcell-builder"
10
+ git_branch=` git branch --list -r --contains HEAD | grep -v ' origin/HEAD' | cut -d' /' -f2`
11
+ popd
12
+
13
+ echo " detected bosh-linux-stemcell-builder will build from branch $git_branch ..."
14
+
15
+ if [ " $git_branch " = " master" ]; then
16
+ version_must_match=' ^[0-9]+\.0\.0$'
17
+ else
18
+ version_must_match=" ^${git_branch// x/ [0-9]+.0} $"
19
+ version_must_match=" ${version_must_match// ./ \. } "
20
+ fi
21
+
22
+ echo " will only continue if version to promote matches $version_must_match ..."
23
+
24
+ if [[ $semver =~ $version_must_match ]]; then
25
+ echo " version $semver is appropriate for branch $git_branch -- promote will continue"
26
+ exit 0
27
+ fi
28
+
29
+ echo " version $semver DOES NOT ALIGN with branch $git_branch -- promotion canceled!"
30
+
31
+ exit 1
32
+
Original file line number Diff line number Diff line change
1
+ ---
2
+ platform : linux
3
+
4
+ image_resource :
5
+ type : docker-image
6
+ source :
7
+ repository : bosh/agent
8
+
9
+ inputs :
10
+ - name : bosh-linux-stemcell-builder
11
+ - name : version
12
+
13
+ params : {}
14
+
15
+ run :
16
+ path : bosh-linux-stemcell-builder/ci/tasks/assert-version-aligns.sh
You can’t perform that action at this time.
0 commit comments