1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-03 09:49:15 +02:00
deltachat-core/.scripts/deploy.sh
2018-09-25 16:05:57 +02:00

26 lines
974 B
Bash
Executable file

#!/bin/bash
set -e
set -u
set -x
#Only attempt to deploy if we know the ssh key secrets, username and server
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
# Prepare the ssh homedir.
#
# 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_49475b8073e9_key -iv $encrypted_49475b8073e9_iv
-in .credentials/delta.id_rsa.enc -out ~/.ssh/id_rsa -d
chmod 600 ~/.ssh/id_rsa
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/\//_}