forked from geostreams/geostreams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
37 lines (29 loc) · 988 Bytes
/
release.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
35
36
37
#!/bin/bash
# exit on error, with error code
set -e
# can use the following to push to NCSA registry for testing:
# BRANCH="master" SERVER=hub.ncsa.illinois.edu/ ./release.sh
# use DEBUG=echo ./release.sh to print all commands
export DEBUG=${DEBUG:-""}
# use SERVER=XYZ/ to push to a different server
SERVER=${SERVER:-""}
# what branch are we on
BRANCH=${BRANCH:-"$(git rev-parse --abbrev-ref HEAD)"}
# make sure docker is build
${DEBUG} $(dirname $0)/docker.sh
# find out the version
if [ "${BRANCH}" = "master" ]; then
VERSION=${VERSION:-"3.0.0-beta latest"}
elif [ "${BRANCH}" = "develop" ]; then
VERSION="develop"
else
# exit 0
VERSION=${VERSION:-"3.0.0-beta latest"}
fi
# tag all images and push if needed
for v in ${VERSION}; do
if [ "$v" != "latest" -o "$SERVER" != "" ]; then
${DEBUG} docker tag geostreams/geostreams-api:latest ${SERVER}geostreams/geostreams-api:${v}
fi
${DEBUG} docker push ${SERVER}geostreams/geostreams-api:${v}
done