From 2f8d5801efb6bc86ec2fbeec6fbfe6b5dacacedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 26 Dec 2023 09:04:02 -0500 Subject: [PATCH] refactor(ci): add dump/copy step to ci deploy pipeline --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 902a31c..97ce408 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ build_stage: script: # install & build the NuxtJS application - apt update - - apt-get install -y --no-install-recommends python3 build-essential + #- apt-get install -y --no-install-recommends python3 build-essential - npm install - npm run build # define artifacts which are shared between stages @@ -31,7 +31,7 @@ deploy_stage: # install needed packages # add the SSH key from the variable SSH_DEPLOY_KEY and disable StrictHostKeyChecking before_script: - - apt-get update && apt-get install --yes --no-install-recommends rsync git openssh-client curl + - apt-get update && apt-get install --yes --no-install-recommends rsync git openssh-client curl sshpass - eval $(ssh-agent -s) - chmod 600 ${SSH_DEPLOY_KEY} - ssh-add ${SSH_DEPLOY_KEY} @@ -45,7 +45,8 @@ deploy_stage: #- rsync --archive --delete ${CI_PROJECT_DIR}/cnf/ ${DEPLOY_USER}@${DEPLOY_SERVER}:~/cnf/ # restart Node.js and reload nginx configuration - - ssh rockfic@${DEPLOY_SERVER} 'mongosh mongodb://localhost --eval "use ${DB_NAME}; db.dropDatabase();"' + - 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} '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} systemctl reload apache2