Skip to content

Instantly share code, notes, and snippets.

@hcastillaq
Created January 24, 2020 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcastillaq/9868817641147ca935cf34bb665818ca to your computer and use it in GitHub Desktop.
Save hcastillaq/9868817641147ca935cf34bb665818ca to your computer and use it in GitHub Desktop.
ssh gitlab ci
deploy:
image: alpine
stage: deploy
script:
- apk add --no-cache rsync openssh
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
- chmod 600 ~/.ssh/id_dsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- touch hola.txt
- echo $SSH_PORT
- rsync -rvz -e "ssh -p $SSH_PORT" --progress hola.txt $SSH_HOST:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment