Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
travis: add encrypted ssh secret key
Browse files Browse the repository at this point in the history
  • Loading branch information
azul committed Sep 25, 2018
1 parent 34a7a42 commit 18eb05d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Binary file added .credentials/delta.id_rsa.enc
Binary file not shown.
10 changes: 4 additions & 6 deletions .scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -u
set -x

#Only attempt to deploy if we know the ssh key secrets, username and server
if test -z ${encrypted_ee89c1e228aa_key:+decryp_key} ; then exit 0; fi
if test -z ${encrypted_ee89c1e228aa_iv:+decrypt_iv} ; then exit 0; fi
if test -z ${encrypted_49475b8073e9_key:+decryp_key} ; then exit 0; fi
if test -z ${encrypted_49475b8073e9_iv:+decrypt_iv} ; then exit 0; fi
if test -z ${DEPLOY_USER:+username} ; then exit 0; fi
if test -z ${DEPLOY_SERVER:+server} ; then exit 0; fi

Expand All @@ -14,15 +14,13 @@ if test -z ${DEPLOY_SERVER:+server} ; then exit 0; fi
# Decrypting the ssh private key for deploying to the server.
# See https://docs.travis-ci.com/user/encrypting-files/ for details.
mkdir -p -m 0700 ~/.ssh
openssl aes-256-cbc -K $encrypted_ee89c1e228aa_key -iv $encrypted_ee89c1e228aa_iv -in .credentials/autocrypt.id_rsa.enc -out ~/.ssh/id_rsa -d
openssl aes-256-cbc -K $encrypted_49475b8073e9_key -iv $encrypted_49475b8073e9_iv
-in .credentials/delta.id_rsa.enc -out ~/.ssh/id_rsa -d
chmod 600 ~/.ssh/id_rsa
cat .credentials/autocrypt.org.hostkeys >> ~/.ssh/known_hosts
printf "Host *\n" >> ~/.ssh/config
printf " %sAuthentication no\n" ChallengeResponse Password KbdInteractive >> ~/.ssh/config


# Perform the actual deploy
rsync -avz $TRAVIS_BUILD_DIR/doc/_build/html/ \
${DEPLOY_USER}@${DEPLOY_SERVER}:build/${TRAVIS_BRANCH/\//_}
rsync -avz $TRAVIS_BUILD_DIR/doc/_build/latex/autocrypt*.pdf \
${DEPLOY_USER}@${DEPLOY_SERVER}:build/${TRAVIS_BRANCH/\//_}

0 comments on commit 18eb05d

Please sign in to comment.