Merge pull request #354 from nmarley/fix-deploy

clean up / simplify deploy
This commit is contained in:
Nathan Marley 2017-10-01 10:54:12 +08:00 committed by GitHub
commit e5035d771c
2 changed files with 8 additions and 19 deletions

View file

@ -9,7 +9,10 @@ script:
- test -d _site/ && test -s _site/index.html - test -d _site/ && test -s _site/index.html
before_deploy: before_deploy:
- ssh-keyscan -H -t rsa,dsa $hostname >> ~/.ssh/known_hosts - openssl aes-256-cbc -k "$dash_org_pem_pass" -in dash.org-test-web.pem.enc -out /tmp/deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 0600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
addons: addons:
ssh_known_hosts: ssh_known_hosts:
@ -18,6 +21,6 @@ addons:
deploy: deploy:
provider: script provider: script
skip_cleanup: true skip_cleanup: true
script: bash script/deploy-rsync.sh script: DEPLOY_USER=$STAGE_DEPLOY_USER DEPLOY_HOST=$STAGE_DEPLOY_HOST DEPLOY_PATH=$STAGE_DEPLOY_PATH bash script/deploy-rsync.sh
on: on:
branch: master branch: master

View file

@ -1,19 +1,5 @@
#!/bin/bash #! /bin/bash
set -e set -xe
# punt if PR rsync -vzrlptD --delete-after $TRAVIS_BUILD_DIR/_site/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then
echo "IS PULL REQUEST: Skipping deploy rsync"
elif [[ ! -z "$dash_org_pem_pass" ]]; then
echo -n "DEPLOY - decrypting key..."
openssl aes-256-cbc -k "$dash_org_pem_pass" -in dash.org-test-web.pem.enc -out dash.org-test-web.pem -d
chmod 600 dash.org-test-web.pem
echo "DONE"
echo "DEPLOY - copying content..."
export RSYNC_RSH='ssh -i dash.org-test-web.pem'
rsync -r -c -v --delete-after --exclude-from 'ciexclude.txt' $TRAVIS_BUILD_DIR/_site/ $user@$hostname:$production_path
echo "DONE"
else
echo "SKIPPING SITE DEPLOY "
fi