forked from HBPMedical/algorithm-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·34 lines (27 loc) · 821 Bytes
/
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
#!/bin/bash -e
get_script_dir () {
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
cd -P "$( dirname "$SOURCE" )"
pwd
}
ROOT_DIR="$(get_script_dir)"
if groups $USER | grep &>/dev/null '\bdocker\b'; then
CAPTAIN="captain"
DOCKER="docker"
else
CAPTAIN="sudo captain"
DOCKER="sudo docker"
fi
IMAGES="r-summary-stats r-linear-regression java-rapidminer java-jsi-clus-pct java-jsi-clus-pct-ts python-jsi-hedwig python-jsi-hinmine"
commit_id="$(git rev-parse --short HEAD)"
for image in $IMAGES ; do
cd $ROOT_DIR/$image
$CAPTAIN test
$DOCKER push hbpmip/$image:$commit_id
$DOCKER push hbpmip/$image:latest
done