Skip to content

Commit

Permalink
Update SSH keyscan command to include SSH port
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Nov 20, 2023
1 parent 69d3b32 commit 8bba4f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ deploy-job:
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_IP >> ~/.ssh/known_hosts
- ssh-keyscan -p $SSH_PORT $SSH_IP >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh $SSH_USER@$SSH_IP "
- ssh -p $SSH_PORT $SSH_USER@$SSH_IP "
. ~/.zshrc &&
cd /home/$SSH_USER/www/$CI_PROJECT_NAME &&
git pull &&
/home/$SSH_USER/.nvm/versions/node/v$NODE_VERSION/bin/pnpm i &&
/home/$SSH_USER/.nvm/versions/node/v$NODE_VERSION/bin/pnpm build &&
pm2 restart $PM2 &&
notifier '$CI_PROJECT_TITLE deployed'"
notifier discord '$CI_PROJECT_TITLE deployed'"
only:
- main

0 comments on commit 8bba4f9

Please sign in to comment.