forked from notional-labs/multisig-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
30 lines (25 loc) · 889 Bytes
/
deploy.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
#!/bin/bash
git stash save --keep-index --include-untracked
git pull
export PATH=/root/.nvm/versions/node/v18.9.0/bin:$PATH
if ! [ $? -eq 0 ]; then
echo "git pull failed with errors."
exit 1
fi
if [ -f "../env-multisig" ]; then
echo "Multisig env file exists."
cp ../env-multisig .env
fi
cp multisig.notional.ventures.service /etc/systemd/system/multisig.notional.ventures.service
systemctl stop multisig.notional.ventures.service
systemctl daemon-reload
echo "Service file copied!"
npm install
npm run build
if [ $? -eq 0 ]; then
systemctl restart multisig.notional.ventures.service
systemctl is-active --quiet multisig.notional.ventures.service && echo "Multisig web server restarted successfully." || (echo "Multisig web server failed to restart." && exit 1)
else
echo "npm run build failed with error. Stopped restarting the web server."
exit 1
fi