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