This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·82 lines (75 loc) · 1.98 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e
SCRIPTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
#-----------------------------------------------------------------------
# Helper functions (miscellaneous)
#-----------------------------------------------------------------------
CONSOLE_CYAN="\033[1m\033[36m"; CONSOLE_NORMAL="\033[0m"; CONSOLE_RED="\033[1m\033[91m"
printMsg() {
printf "${CONSOLE_CYAN}${1}${CONSOLE_NORMAL}\n"
}
printError() {
printf "${CONSOLE_RED}${1}${CONSOLE_NORMAL}\n"
}
#-----------------------------------------------------------------------
# MAIN
#-----------------------------------------------------------------------
DEV=false
DEV_ARG=""
PROMPT=true
PROMPT_ARG=""
BRANCH_TO_CHECK="master"
while test $# -gt 0
do
case "$1" in
--dev)
DEV=true
DEV_ARG="--dev"
BRANCH_TO_CHECK="develop"
;;
-y)
PROMPT=false
PROMPT_ARG="-y"
;;
*) echo "Bad option $1"
exit 1
;;
esac
shift
done
printMsg "Welcome to dataClay release script"
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$GIT_BRANCH" != "$BRANCH_TO_CHECK" ]]; then
printError "Branch is not $BRANCH_TO_CHECK. Aborting script";
exit 1;
fi
read -p "Did you release javaclay and pyclay? (y/n) " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
printError "Please release both packages first"
fi
if [ "$DEV" = false ] ; then
cd $SCRIPTDIR/orchestration
./release.sh $PROMPT_ARG
cd $SCRIPTDIR
fi
cd $SCRIPTDIR/docker
if [ "$DEV" = false ] ; then
# TODO: make sure dspython requirements are pushed
VERSION=$(cat VERSION.txt)
VERSION="${VERSION//.dev/}"
echo "${VERSION}" > VERSION.txt
./deploy.sh $DEV_ARG $PROMPT_ARG --release
git add VERSION.txt
else
./deploy.sh $PROMPT_ARG
fi
cd $SCRIPTDIR
cd $SCRIPTDIR/hpc/mn
./deploy.sh $DEV_ARG $PROMPT_ARG
cd $SCRIPTDIR
if [ "$DEV" = false ] ; then
bash $SCRIPTDIR/misc/prepare_release.sh
fi
printMsg "dataClay successfully released! :)"