forked from sem-con/sc-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (33 loc) · 775 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·39 lines (33 loc) · 775 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
CONTAINER="sc-base"
REPOSITORY="semcon"
# 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
rails r script/clean.rb
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