File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This file is sourced in to the CI environment
2
+ # in .gitlab-ci.yml
3
+ #
4
+
5
+ # Sets the error behaviour options for shell throughout the CI environment
6
+ #
7
+ set -o errexit # Exit if command failed.
8
+ set -o pipefail # Exit if pipe failed.
9
+
10
+ # we can use the appropriate secret variable for debugging
11
+ [ ! -z $DEBUG_SHELL ] && set -x
12
+
13
+ [ -z $CI_COMMIT_REF_NAME ] && echo " This internal script should only be run by a Gitlab CI runner." && exit 1
14
+
15
+ # Sets IS_PUBLIC and IS_PRIVATE based on branch type
16
+ #
17
+ # Public branches are:
18
+ # release branches - start with release/
19
+ # release tags - look like vXX.YY or vXX.YY.ZZ with an optional dash followed by anything on the end
20
+ # master branch
21
+ #
22
+ # These POSIX REs are equivalent to the REs in some "only:" sections of the gitlab-ci.yml file
23
+ #
24
+ REF=$CI_COMMIT_REF_NAME
25
+ if [[ $REF = " master" || $REF =~ ^release/v || $REF =~ ^v[0-9]+\. [0-9]+ (\. [0-9]+)? (-| $) ]]; then
26
+ export IS_PRIVATE=
27
+ export IS_PUBLIC=1
28
+ else
29
+ export IS_PRIVATE=1
30
+ export IS_PUBLIC=
31
+ fi
32
+ unset REF
You can’t perform that action at this time.
0 commit comments