1
0
Fork 0

Simplify deployment method

Using the File type from the Gitlab CI/CD pipeline options, specify the required
files on the command line directly instead of writing to them from a script. SSH
won’t accept the identity file specified (‘DEPLOY_KEY’) if its file permissions
are more permissive than 600.
This commit is contained in:
Tom Willemse 2019-08-19 23:33:10 -07:00
parent 8386052858
commit 2d05019aa6

View file

@ -40,11 +40,7 @@ deploy:
dependencies: dependencies:
- package - package
before_script: before_script:
- mkdir ~/.ssh/ - chmod 600 "$DEPLOY_KEY"
- echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "$SSH_CONFIG" > ~/.ssh/config
- echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts
- apk update && apk add rsync - apk update && apk add rsync
script: script:
- rsync -v -c -r --delete bin/ "elpa@ryuslash.org:" - rsync -e "ssh -o \"UserKnownHostsFile $KNOWN_HOSTS\" -p 4511 -i $DEPLOY_KEY" -v -c -r --delete bin/ "elpa@ryuslash.org:"