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