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,12 +14,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Garantindo Safe Directory
|
- 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
|
- name: Deploy da aplicação
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
sudo chown -R desenvolvimento:desenvolvimento /opt/HUBXGLPI
|
||||||
|
|
||||||
|
sudo -H -u desenvolvimento bash -lc '
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
cd /opt/HUBXGLPI
|
cd /opt/HUBXGLPI
|
||||||
|
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
@ -28,13 +33,18 @@ jobs:
|
|||||||
|
|
||||||
npm ci --omit=dev
|
npm ci --omit=dev
|
||||||
|
|
||||||
pm2 reload ecosystem.config.js --env production || pm2 start ecosystem.config.js --env production
|
./node_modules/.bin/pm2 reload ecosystem.config.js --env production || ./node_modules/.bin/pm2 start ecosystem.config.js --env production
|
||||||
pm2 save
|
./node_modules/.bin/pm2 save
|
||||||
|
'
|
||||||
- name: Exibir logs da aplicação
|
- name: Exibir logs da aplicação
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
sleep 3
|
sleep 3
|
||||||
|
sudo -H -u desenvolvimento bash -lc '
|
||||||
|
cd /opt/HUBXGLPI
|
||||||
|
|
||||||
echo "=== API ==="
|
echo "=== API ==="
|
||||||
pm2 logs hubxglpi-api --lines 15 --nostream
|
./node_modules/.bin/pm2 logs hubxglpi-api --lines 15 --nostream
|
||||||
echo "=== CRON ==="
|
echo "=== CRON ==="
|
||||||
pm2 logs hubxglpi-cron --lines 10 --nostream
|
./node_modules/.bin/pm2 logs hubxglpi-cron --lines 10 --nostream
|
||||||
|
'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user