fixed error handling, fixed parameter handling
This commit is contained in:
15
deploy.sh
15
deploy.sh
@@ -12,21 +12,26 @@ Fail() {
|
||||
}
|
||||
|
||||
Exec() {
|
||||
if [[ -z $2 ]] {
|
||||
then
|
||||
echo -e "${RED}application not specified, failing${NOCOL}"
|
||||
exit 1
|
||||
}
|
||||
case $1 in
|
||||
install)
|
||||
echo -e "${GREEN}Starting installation of $1${NOCOL}"
|
||||
echo -e "${GREEN}Starting installation of $2${NOCOL}"
|
||||
sleep 2
|
||||
bash -c "$(curl -fsSL $CODE/$1/install.sh)"
|
||||
bash -c "$(curl -fsSL $CODE/$2/install.sh)"
|
||||
exit 0;;
|
||||
setup)
|
||||
echo -n "Git username: "
|
||||
read USER
|
||||
echo -n "Git password: "
|
||||
read -s PASS
|
||||
echo -e "${GREEN}Starting setup of $1${NOCOL}"
|
||||
echo -e "${GREEN}Starting setup of $2${NOCOL}"
|
||||
sleep 2
|
||||
curl -u $USER:$PASS -so /tmp/$1.tmp $SECRET/$1/setup.env
|
||||
bash -c "$(curl -fsSL $CODE/$1/setup.sh)"
|
||||
curl -u $USER:$PASS -so /tmp/$2.tmp $SECRET/$2/setup.env
|
||||
bash -c "$(curl -fsSL $CODE/$2/setup.sh)"
|
||||
rm -f /tmp/$1.tmp
|
||||
exit 0;;
|
||||
*)
|
||||
|
Reference in New Issue
Block a user