Skip to content

Commit

Permalink
Merge branch 'chore/upgrade-node' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Jul 24, 2024
2 parents 0b8441e + 09ba082 commit e9fe7c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
v20
2 changes: 1 addition & 1 deletion e2e/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
v20
13 changes: 8 additions & 5 deletions script/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ echo "set project directory"
cd "$(dirname "$(readlink -f "$0")")"
cd ".."

export PATH="$HOME/.local/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
. $NVM_DIR/nvm.sh

Expand All @@ -22,10 +23,12 @@ yarn transifex:pull
echo "--> Building assets"
yarn build

echo "--> Restarting server"

if [ $1 = "staging" ]; then
pm2 restart otp-portal-staging --update-env
else
if pm2 describe otp-portal > /dev/null; then
echo "--> Restarting application"
pm2 restart otp-portal --update-env
else
echo "--> Setting up a new application"
pm2 start index.js --name otp-portal
sudo env PATH=$PATH:/home/ubuntu/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u ubuntu --hp /home/ubuntu
pm2 save
fi

0 comments on commit e9fe7c6

Please sign in to comment.