Skip to content

Commit

Permalink
Update SSH configuration and remove unnecessary
Browse files Browse the repository at this point in the history
SSH port specification
  • Loading branch information
ewilan-riviere committed Nov 20, 2023
1 parent 102ddd7 commit 321c779
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ deploy-job:
- 'command -v ssh-agent >/dev/null || ( apk add --update openssh )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo "Host host" >> ~/.ssh/config
- echo " Port $SSH_PORT" >> ~/.ssh/config
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -p $SSH_PORT $SSH_IP >> ~/.ssh/known_hosts
- ssh-keyscan $SSH_IP >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "Host host" >> ~/.ssh/config
- echo " Port $SSH_PORT" >> ~/.ssh/config
- echo "Installing dependencies..."
- apt-get update -qq && apt-get install -y -qq sshpass
- apt-get install -y -qq rsync
- echo "Setup..."
- git clone https://gitlab.com/ewilan-riviere/portfolio.git
- cd portfolio
- scp -P $SSH_PORT $SSH_USER@$SSH_IP:/home/$SSH_USER/www/$CI_PROJECT_NAME/.env .env
- scp $SSH_USER@$SSH_IP:/home/$SSH_USER/www/$CI_PROJECT_NAME/.env .env
- npm install -g pnpm
- pnpm i
- echo "Building..."
- pnpm build
- echo "Deploying..."
script:
- rsync -azPhhr .output $SSH_USER@$SSH_IP:/home/$SSH_USER/www/$CI_PROJECT_NAME/.output-$CI_JOB_ID
- ssh -p $SSH_PORT $SSH_USER@$SSH_IP "
- ssh $SSH_USER@$SSH_IP "
. ~/.zshrc &&
cd /home/$SSH_USER/www/$CI_PROJECT_NAME &&
git pull &&
Expand Down

0 comments on commit 321c779

Please sign in to comment.