fix(ci): make sure to restore dump on staging server

This commit is contained in:
parent 2f8d5801ef
commit eba0670703
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -47,6 +47,7 @@ deploy_stage:
# restart Node.js and reload nginx configuration # restart Node.js and reload nginx configuration
- sshpass -p "${OLDROOTPWD}" ssh root@rockfic.com 'bash ~/cp.sh' - sshpass -p "${OLDROOTPWD}" ssh root@rockfic.com 'bash ~/cp.sh'
- ssh rockfic@${DEPLOY_SERVER} 'mongosh mongodb://localhost --eval "'"use ${DB_NAME}; db.dropDatabase();" - ssh rockfic@${DEPLOY_SERVER} 'mongosh mongodb://localhost --eval "'"use ${DB_NAME}; db.dropDatabase();"
- ssh rockfic@${DEPLOY_SERVER} 'mongorestore -d rockfic_old dump/rockfic
- ssh rockfic@${DEPLOY_SERVER} 'cd migrator && bun install && bun run ./index.ts' - ssh rockfic@${DEPLOY_SERVER} 'cd migrator && bun install && bun run ./index.ts'
- ssh rockfic@${DEPLOY_SERVER} node run "~/rockfic-staging/.output/server/index.mjs" \&\>/dev/null \& disown \%1 - ssh rockfic@${DEPLOY_SERVER} node run "~/rockfic-staging/.output/server/index.mjs" \&\>/dev/null \& disown \%1
- ssh rockfic@${DEPLOY_SERVER} systemctl reload apache2 - ssh rockfic@${DEPLOY_SERVER} systemctl reload apache2