-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (34 loc) · 851 Bytes
/
build.sh
File metadata and controls
executable file
·39 lines (34 loc) · 851 Bytes
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
#!/bin/bash
REPOSITORY="semcon"
CONTAINER="srv-semantics"
# read commandline options
BUILD_CLEAN=false
DOCKER_UPDATE=false
while [ $# -gt 0 ]; do
case "$1" in
--clean*)
BUILD_CLEAN=true
;;
--dockerhub*)
DOCKER_UPDATE=true
;;
*)
printf "unknown option(s)\n"
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
return 1
else
exit 1
fi
esac
shift
done
if $BUILD_CLEAN; then
mvn clean install
cp target/validation-service-*-SNAPSHOT-jar-with-dependencies.jar docker
docker build --no-cache -f ./docker/Dockerfile -t $REPOSITORY/$CONTAINER .
else
docker build -f ./docker/Dockerfile -t $REPOSITORY/$CONTAINER .
fi
if $DOCKER_UPDATE; then
docker push $REPOSITORY/$CONTAINER
fi