Commit cd5788c2 authored by Christoph Groth's avatar Christoph Groth
Browse files

deploy: feed private key directly to agent

parent 3a90b753
...@@ -2,19 +2,20 @@ image: kwant/website-deploy ...@@ -2,19 +2,20 @@ image: kwant/website-deploy
before_script: before_script:
- nikola build - nikola build
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
test_deploy: test_deploy:
script: script:
- mkdir -p ~/.ssh - echo "$TEST_WEBSITE_KEY" | tr -d '\r' | ssh-add -
- echo $TEST_WEBSITE_KEY > deploy_key && sed -i 's/\r /\n/g' deploy_key && chmod 600 deploy_key
- nikola deploy - nikola deploy
except: except:
- master - master
master_deploy: master_deploy:
script: script:
- mkdir -p ~/.ssh - echo "$MASTER_WEBSITE_KEY" | tr -d '\r' | ssh-add -
- echo $MASTER_WEBSITE_KEY > deploy_key && sed -i 's/\r /\n/g' deploy_key && chmod 600 deploy_key
- nikola deploy - nikola deploy
only: only:
- master - master
...@@ -373,17 +373,16 @@ REDIRECTIONS = [] ...@@ -373,17 +373,16 @@ REDIRECTIONS = []
# rsync is used to send documentation to our web servers: we never send any # rsync is used to send documentation to our web servers: we never send any
# secret information, and using 'ssh-keyscan' causes the CI server's IP to # secret information, and using 'ssh-keyscan' causes the CI server's IP to
# be blacklisted, so we specify "StrictHostKeyChecking=no". # be blacklisted, so we specify "StrictHostKeyChecking=no".
SSH_OPTS = ["StrictHostKeyChecking=no", "UserKnownHostsFile=/dev/null", SSH_OPTS = ["StrictHostKeyChecking=no", "UserKnownHostsFile=/dev/null"]
"IdentitiesOnly=yes"]
SSH_OPTS = ' '.join('-o ' + opt for opt in SSH_OPTS) SSH_OPTS = ' '.join('-o ' + opt for opt in SSH_OPTS)
DEPLOY_COMMANDS = { DEPLOY_COMMANDS = {
'default': [ 'default': [
"rsync -rlv -e 'ssh {} -i deploy_key' --delete " "rsync -rlv -e 'ssh {}' --delete "
"--filter 'P doc/*' --filter 'P extensions/*' output/* kwant@kwant-project.org:" "--filter 'P doc/*' --filter 'P extensions/*' output/* kwant@kwant-project.org:"
.format(SSH_OPTS), .format(SSH_OPTS),
"rsync -lv -e 'ssh {} -i deploy_key' htaccess-apache kwant@kwant-project.org:/.htaccess" "rsync -lv -e 'ssh {}' htaccess-apache kwant@kwant-project.org:/.htaccess"
.format(SSH_OPTS), .format(SSH_OPTS),
] ]
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment