forked from HiddenField/dynamic-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-build.sh
executable file
·39 lines (37 loc) · 963 Bytes
/
docker-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
35
36
37
38
39
#!/usr/bin/env bash
usage() {
echo "docker-build.sh [-n]" 1>&2;
echo " -n Do not update to latest submodule(s) from remote. Use committed submodule version and update to that version" 1>&2
exit 1;
}
UPDATE_REMOTE="-r"
UPDATE_SUBMODULES=true
while getopts "nshc:" o; do
case "${o}" in
n)
echo "Not updating submodules from remote"
unset UPDATE_REMOTE
;;
s)
echo "Not updating submodules"
UPDATE_SUBMODULES=false
;;
c)
COMMITID=${OPTARG}
;;
h)
usage
;;
*)
usage
;;
esac
done
if [ "${UPDATE_SUBMODULES}" == "true" ]; then
echo "Updating submodules"
if ! [ -z ${COMMITID+x} ]; then
EXTRAPARAM="-c ${COMMITID}"
fi
./update-submodules.sh ${UPDATE_REMOTE} ${EXTRAPARAM}
fi
docker build --rm -f "dockerfile" -t dynamicd-testing:latest .