Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
set -o nounset
set -o errexit
CI_TAG=sodium
function print_the_help {
echo "USAGE: $0 [-t <runner_tag>] "
echo " OPTIONS: "
echo " -t,--tag Gitlab Runner tag"
exit
}
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-t|--tag)
CI_TAG="$2"
shift # past argument
shift # past value
;;
*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1"
print_the_help
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
cat <<EOF
cal_test1:
stage: detectors
tags:
- ${CI_TAG}
script:
- bash calorimeters/dummy_test.sh
allow_failure: true
cal_test2:
stage: detectors
tags:
- ${CI_TAG}
script:
- root -b -q calorimeters/zdc_neutrons_reader.cxx
allow_failure: true
EOF