forked from cta-wave/dpctf-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·34 lines (27 loc) · 760 Bytes
/
build.sh
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
#!/bin/bash
reload_runner=false
reload_tests=false
tests_branch="master"
has_tests_branch=false
for var in "$@"
do
if [ $has_tests_branch = true ]; then
tests_branch="$var";
has_tests_branch=false;
fi;
if [ "$var" == "--reload-runner" ]; then
reload_runner=true;
elif [ "$var" == "--reload-tests" ]; then
reload_tests=true;
elif [ "$var" == "--tests-branch" ]; then
has_tests_branch=true;
fi
done
args=""
if [ $reload_runner = true ]; then
args="$args --build-arg runner-rev=\"$(date | sed "s/ //g")\""
fi
if [ $reload_tests = true ]; then
args="$args --build-arg tests-rev=\"$(date | sed "s/ //g")\""
fi
docker build --network="host" --build-arg commit=$1 --build-arg testsbranch="$tests_branch" $args -t dpctf:$2 .