You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy.sh
+59-48Lines changed: 59 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -78,28 +78,27 @@ for i in "$@"; do
78
78
echo -e "${BRed}Error: Invalid setup option '$setup'. Please use 'full' or 'only'. ${Color_Off}"
79
79
exit 1
80
80
else
81
-
echo -e "${BCyan}You included the setup option '$setup'.${Color_Off} (Please be careful with this option, as it can cause issues if not used correctly.)"
81
+
echo -e "\nYou included the setup option '$setup'. (Please be careful with this option, as it can cause issues if not used correctly.)"
82
82
printf"${BCyan}How many commands do you want to run on the remote server(s)?: ${Color_Off}"
echo -e \"${Cyan}Rolling back to version: ${BCyan}\$f${Color_Off}\n\"
199
-
ln -s \$(readlink -f \$f) ../current
200
-
ls -l .. | grep current
201
-
sudo systemctl restart $restart_services
202
-
echo -e \"${Cyan}Service statuses after restart:${Color_Off}\n\"
203
-
sudo systemctl status $restart_services --no-pager
204
-
echo -e \"${Green}Rollback completed on server name: $i.${Color_Off}\n\"
205
-
'"
206
-
done
207
-
echo -e "${BCyan}Done. Bye!${Color_Off}"
208
-
exit 0
209
209
fi
210
210
211
211
echo -e "\n${BYellow}Please note that this script does not provide full graceful error handling, so that you don't live with a broken app.${Color_Off}\n"
cd $DEPLOY_DIR/$file/ && sudo rm -rf /tmp/$file.tgz
307
318
$define_api
308
-
if [ -n $restart_services ]; then
309
-
if sudo systemctl status $restart_services >/dev/null 2>&1; then
310
-
echo "\n✅ Services are running fine. Restarting: $restart_services"
311
-
sudo systemctl restart $restart_services
312
-
echo -e "${Green}Setup completed successfully on server name: $i.${Color_Off}"
319
+
if [ -n "${restart_services[@]}" ]; then
320
+
if sudo systemctl status ${restart_services} >/dev/null 2>&1; then
321
+
echo "\n${Green}✅ Services are running fine.${Color_off} Restarting: ${restart_services[@]}"
322
+
sudo systemctl restart ${restart_services[@]}
323
+
echo -e "${Green}✅ Setup completed successfully on server name: $i.${Color_Off}"
313
324
else
314
325
echo "❌ Some services might be dead or unavailable. Please check your setup. Full setup failed."
315
326
fi
316
327
fi
317
328
EOF
318
329
319
-
echo -e "${Green}Your newest app release ($file) is now live on -> ($i)!${Color_Off}\nYou can visit: $i/ to use app if the services are set up correctly.\n"
330
+
echo -e "${Green}Your newest app release ($file) is now live on -> ($i)!${Color_Off}\nYou can use your app if the services are set up correctly.\n"
0 commit comments