Skip to content

Commit

Permalink
fix: update travis config for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
PofMagicfingers committed Apr 28, 2020
1 parent 798c99d commit 55c5015
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ before_deploy:
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
- ssh-keyscan barry.podshows.fr >> ~/.ssh/known_hosts
- ssh-keyscan -p4242 barry.podshows.fr >> ~/.ssh/known_hosts
deploy:
- provider: script
script: "./deploy.sh"
Expand Down
7 changes: 4 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR

SSH_HOST=podcloud@barry.podshows.fr
SSH_PORT=4242
COMPOSE_PROJECT_NAME=podcloud
BASE=/home/podcloud/production/services/feeds
KEEP_RELEASES=2

RELEASEN=$(date -u +%Y%m%d%H%M%S)

echo "Creating release"
ssh $SSH_HOST BASE=$BASE RELEASEN=$RELEASEN 'bash -s' <<'CMD'
ssh -p$SSH_PORT $SSH_HOST BASE=$BASE RELEASEN=$RELEASEN 'bash -s' <<'CMD'
mkdir -vp $BASE/releases/$RELEASEN
CMD

rsync -avzPhc --recursive --files-from=deploy.files . $SSH_HOST:$BASE/releases/$RELEASEN/
rsync -e "ssh -p$SSH_PORT" -avzPhc --recursive --files-from=deploy.files . $SSH_HOST:$BASE/releases/$RELEASEN/

ssh $SSH_HOST BASE=$BASE KEEP_RELEASES=$KEEP_RELEASES RELEASEN=$RELEASEN COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME 'bash -s' <<'CMD'
ssh -p$SSH_PORT $SSH_HOST BASE=$BASE KEEP_RELEASES=$KEEP_RELEASES RELEASEN=$RELEASEN COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME 'bash -s' <<'CMD'
# exit when any command fails
set -e
Expand Down

0 comments on commit 55c5015

Please sign in to comment.