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
Setup command should be after npm packages are installed to avoid errors. Also added support for setup command in config, so that users don't have to run setup command everytime
Copy file name to clipboardExpand all lines: deploy.conf
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ SERVERS="libly.liny.studio," # list of servers to deploy to. Comma separated. Th
7
7
TYPE="domain"# type of lookup (domain or ip)
8
8
SERVICES=""# Service names to restart after deployment. Best to pass this to on the command line. Defining it here will cause all services to be restarted which is a bad idea.
9
9
NODE_HOME="./api"# use relative path
10
+
SETUP_COMMAND="cd ~/.Libly/current/client && npm run build"# Command to run after deployment. This is optional. If not defined, the script will not run any command after deployment.
10
11
# This should contain the file name of the js file to modify. This file should be reserved for API HOSTNAME definition. It is optional.
11
12
JSHOST="web_client/static/scripts/API_HOST.js"# Inside the file, the definition should be like this: "export const API_HOST = undefined;" undefined will be replaced with the hostname of the server.
Copy file name to clipboardExpand all lines: deploy.sh
+18-16Lines changed: 18 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ for i in "$@"; do
77
77
if [[ "$setup"!="full"&&"$setup"!="only" ]];then
78
78
echo -e "${BRed}Error: Invalid setup option '$setup'. Please use 'full' or 'only'. ${Color_Off}"
79
79
exit 1
80
-
else
80
+
elif [ -z"$SETUP_COMMAND" ];then
81
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}"
83
83
read -r NUMBER
@@ -139,7 +139,7 @@ if [ -z "$PROJECT_NAME" ]; then
139
139
echo -e "${Cyan}Please note that the project name must match the name of the folder in which the project is located.${Color_Off}"
140
140
fi
141
141
142
-
echo -e "${BGreen}Welcome to the ${BBlue}${PROJECT_NAME}'s ${BGreen}Deployment!${Color_Off}\n"
142
+
echo -e "\n${BGreen}Welcome to the ${BBlue}${PROJECT_NAME} project ${BGreen}deployment!${Color_Off}\n"
143
143
144
144
# Check if host command is available
145
145
if!command -v host &> /dev/null
@@ -162,7 +162,7 @@ if [ "$TYPE" == "domain" ]; then
162
162
exit 1
163
163
fi
164
164
done
165
-
echo -e "${Green}Done! All domain names are valid.${Color_Off}\n"
165
+
echo -e "${Green}Done! All domain names are valid.${Color_Off}"
166
166
else
167
167
# Check for valid IP addresses
168
168
forsin"${SERVERS[@]}";do
@@ -252,8 +252,8 @@ if [ ! -d "$inputFile" ]; then
252
252
fi
253
253
254
254
# Countdown
255
-
echo -e "${BCyan}After this operation, the deployed version will be stored in the folder 'versions/'"
256
-
echo -e "Deployment will commence in 10 seconds. Check if you entered correct information. \nPress ctrl c, to cancel if you made a mistake.${Color_Off}\n"
255
+
echo -e "${Cyan}After this operation, the deployed version will be stored in the folder 'versions/'"
256
+
echo -e "${Color_Off}Deployment will commence in 10 seconds. Check if you entered correct information. \nPress ctrl c, to cancel if you made a mistake.\n"
257
257
258
258
spinner="/|\\-/"
259
259
for((j=10; j>0; j--));do
@@ -276,16 +276,16 @@ if [ ! -d "$inputFile/versions" ]; then
276
276
fi
277
277
278
278
# Create and transfer archive, then deploy to servers
279
-
tar --exclude="versions" --exclude=".git" -czf "$inputFile/versions/$file.tgz" -C "$inputFile".
280
-
echo -e "${Cyan}Archive created successfully. Beginning deployment...${Color_Off}\n"
279
+
tar --exclude="versions" --exclude=".git" --exclude="node_modules" -czf "$inputFile/versions/$file.tgz" -C "$inputFile".
280
+
echo -e "\n${Cyan}Archive created successfully. Beginning deployment...${Color_Off}\n"
281
281
282
282
foriin"${SERVERS[@]}";do
283
283
(
284
-
echo -e "${BBlue}Deploying on server: ${BYellow}\t$i\t...\n${Color_Off}"
284
+
echo -e "${BBlue}Deploying on server: ${BYellow}\t$i\t...\n${Color_Off}"
285
285
if [[ "$*"=~ (^|[[:space:]])--apt-update($|[[:space:]]) ]];then
0 commit comments