-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·54 lines (42 loc) · 1.37 KB
/
make.sh
File metadata and controls
executable file
·54 lines (42 loc) · 1.37 KB
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
#!/usr/bin/env bash
# In order to use this script on Mac OSX, you need a working version of getopt.
# E.g. install through brew install gnu-getopt and add it to the PATH through export PATH=$(brew --prefix gnu-getopt)/bin:$PATH
#
#
# Turn on error handling to avoid snowballing into issues caused by failed commands
set -e
set -x
if [[ $OSTYPE == darwin* ]] && [[ $(which brew) != "" ]] && [[ $(brew --prefix gnu-getopt) != "" ]] ; then
export PATH=$(brew --prefix gnu-getopt)/bin:$PATH;
fi
#
# Use COMPOSE_OPTIONS for customizing general docker-compose options
# e.g. export COMPOSE_OPTIONS="-f docker-compose.backuparchive.yml" for configuring the backup archive volume
#
COMPOSE_OPTIONS="-f docker-compose.yml $COMPOSE_OPTIONS"
function parseArguments() {
args=$(getopt --options t: --longoptions tag: -- "$@")
if [ $? -ne 0 ];
then
exit 1
fi
eval set -- "$args";
while true; do
case $1 in
-t|--tag)
TAG="$2" ;
shift 2;
;;
--)
shift;
break ;;
*) echo "Unimplemented option: $1" >&2; exit 1;;
esac
done
}
parseArguments "$@"
# Building backup image
docker build -t softwarecraftsmen/cron:${TAG:=latest} .
# Building containers
cd demo
docker-compose --project-name cron $COMPOSE_OPTIONS build --build-arg TAG=${TAG}