-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdjambuild
executable file
·41 lines (32 loc) · 937 Bytes
/
djambuild
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
#!/bin/bash
IDIR="${BASH_SOURCE%/*}"
if [[ ! -d "$IDIR" ]]; then IDIR="$PWD"; fi
source "$IDIR/inc/misc_tools.sh"
show_usage() {
cat << EOF
Builds a new docker image using the current JAMScript version in the github repo
at https://github.com/citelab/JAMScript.
Usage: djambuild [repo]
djambuild -h
djambuild --help
Prints this help message.
djambuild repository
Builds a new jamscript docker image and uploads to the given repository.
EOF
}
if [ -z $JAMHOME ]; then
echo "$JAMHOME not set. $JAMHOME needs to point towards a JAMScript source directory."
die
fi
if [ -z $1 ]; then
docker build --no-cache -t jamscript $JAMHOME/scripts/install
docker tag jamscript mahes25/jamscript
docker push mahes25/jamscript
elif [ $1 == "-h" ] || [ $1 == "--help" ]; then
show_usage
exit
else
docker build --no-cache -t jamscript $JAMHOME/scripts/install
docker tag jamscript $1
docker push $1
fi