FIX: executa deploy de produção com usuário desenvolvimento
Some checks failed
Deploy Production / deploy (push) Failing after 0s
Some checks failed
Deploy Production / deploy (push) Failing after 0s
This commit is contained in:
parent
495b32a6a4
commit
7b44180de5
@ -14,27 +14,37 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Garantindo Safe Directory
|
||||
run: git config --global --add safe.directory /opt/HUBXGLPI
|
||||
run: sudo -H -u desenvolvimento git config --global --add safe.directory /opt/HUBXGLPI
|
||||
|
||||
- name: Deploy da aplicação
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
cd /opt/HUBXGLPI
|
||||
sudo chown -R desenvolvimento:desenvolvimento /opt/HUBXGLPI
|
||||
|
||||
git fetch origin master
|
||||
git checkout master
|
||||
git pull --ff-only origin master
|
||||
sudo -H -u desenvolvimento bash -lc '
|
||||
set -euo pipefail
|
||||
|
||||
npm ci --omit=dev
|
||||
cd /opt/HUBXGLPI
|
||||
|
||||
pm2 reload ecosystem.config.js --env production || pm2 start ecosystem.config.js --env production
|
||||
pm2 save
|
||||
git fetch origin master
|
||||
git checkout master
|
||||
git pull --ff-only origin master
|
||||
|
||||
npm ci --omit=dev
|
||||
|
||||
./node_modules/.bin/pm2 reload ecosystem.config.js --env production || ./node_modules/.bin/pm2 start ecosystem.config.js --env production
|
||||
./node_modules/.bin/pm2 save
|
||||
'
|
||||
- name: Exibir logs da aplicação
|
||||
if: success()
|
||||
run: |
|
||||
sleep 3
|
||||
echo "=== API ==="
|
||||
pm2 logs hubxglpi-api --lines 15 --nostream
|
||||
echo "=== CRON ==="
|
||||
pm2 logs hubxglpi-cron --lines 10 --nostream
|
||||
sudo -H -u desenvolvimento bash -lc '
|
||||
cd /opt/HUBXGLPI
|
||||
|
||||
echo "=== API ==="
|
||||
./node_modules/.bin/pm2 logs hubxglpi-api --lines 15 --nostream
|
||||
echo "=== CRON ==="
|
||||
./node_modules/.bin/pm2 logs hubxglpi-cron --lines 10 --nostream
|
||||
'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user