From 2d05019aa60ff29776ac26da150628191049489a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 19 Aug 2019 23:33:10 -0700 Subject: [PATCH] Simplify deployment method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .gitlab-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c768a9d..dcef562 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,11 +40,7 @@ deploy: dependencies: - package before_script: - - mkdir ~/.ssh/ - - echo "$DEPLOY_KEY" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - echo -e "$SSH_CONFIG" > ~/.ssh/config - - echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 600 "$DEPLOY_KEY" - apk update && apk add rsync 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:"