forked from AzHicham/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_dockers.sh
executable file
·55 lines (44 loc) · 1.25 KB
/
build_dockers.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# exit this script with failure on any error
set -e
function show_help() {
cat << EOF
Usage: ${0##*/}
-t navitia docker tag, default to latest
EOF
}
#we want to be able to interupt the build, see: http://veithen.github.io/2014/11/16/sigterm-propagation.html
function run() {
trap 'kill -TERM $PID' TERM INT
$@ &
PID=$!
wait $PID
trap - TERM INT
wait $PID
return $?
}
while getopts "t:" opt; do
case $opt in
t) tag=$OPTARG
;;
h|\?)
show_help
exit 1
;;
esac
done
if [[ -z $tag ]];
then
echo "No tag given for navitia dockers. I'll use tag = latest"
tag="latest"
fi
# fetch loki submodules
run git submodule update --init --recursive
# build the docker for binarisation
run docker build -f docker/bina_dockerfile -t navitia/mc_bina:latest --build-arg NAVITIA_TAG=${tag} .
# build the docker for kraken
run docker build -f docker/kraken_dockerfile -t navitia/mc_kraken:latest --build-arg NAVITIA_TAG=${tag} .
# build the docker for jormun
run docker build -f docker/jormun_dockerfile -t navitia/mc_jormun:latest --build-arg NAVITIA_TAG=${tag} .
# build the docker for server
run docker build -f docker/loki_dockerfile -t navitia/loki:dev .