Created
January 24, 2020 05:59
-
-
Save hcastillaq/9868817641147ca935cf34bb665818ca to your computer and use it in GitHub Desktop.
ssh gitlab ci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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