Skip to content

Commit

Permalink
Changed to use build number instead of ID
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung committed Aug 25, 2019
1 parent 3c51626 commit 2c46c84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ script: vendor/bin/phpunit --verbose
# Purposely leaving trailing slash on the source directory so that the contents get copied
deploy:
- provider: script
script: bash bin/deploy.sh $TRAVIS_BUILD_DIR/ $TRAVIS_BUILD_ID $SSH_USER $SSH_HOST
script: bash bin/deploy.sh $TRAVIS_BUILD_DIR/ $TRAVIS_BUILD_NUMBER $SSH_USER $SSH_HOST
on:
branch: "1.0"
skip_cleanup: true
Expand Down
8 changes: 4 additions & 4 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e

SOURCE_DIR="$1"
BUILD_ID="$2"
BUILD_NUMBER="$2"
SSH_USER="$3"
SSH_HOST="$4"

Expand All @@ -11,9 +11,9 @@ then
exit 1
fi

if [ -z "$BUILD_ID" ]
if [ -z "$BUILD_NUMBER" ]
then
echo "No build ID specified"
echo "No build number specified"
exit 1
fi

Expand All @@ -30,7 +30,7 @@ then
fi

html_dir=/var/www/html
target_dir=$html_dir/releases/$BUILD_ID
target_dir=$html_dir/releases/$BUILD_NUMBER
echo "rsync'ing to host"
rsync -aq --delete-after --rsync-path="mkdir -p $target_dir/ && rsync" "$SOURCE_DIR" $SSH_USER@$SSH_HOST:$target_dir/

Expand Down

0 comments on commit 2c46c84

Please sign in to comment.