Skip to content

Commit

Permalink
.ci/deploy.sh: Shorten line lengths
Browse files Browse the repository at this point in the history
Reduce line lengths to the default 80 chars.
  • Loading branch information
jayvdb authored and gitmate-bot committed Mar 13, 2018
1 parent 9f741eb commit e565fd9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ set -e # Exit with nonzero exit code if anything fails
SOURCE_BRANCH="master"
TARGET_BRANCH="gh-pages"

# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
#if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
# echo "Skipping deploy; just doing a build."
# exit 0
#fi

# Save some useful information
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`

# Clone the existing gh-pages for this repo into out/
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply)
# Clone the existing gh-pages for this repo into out/ .
# Create a new empty branch if gh-pages doesn't exist yet
# (should only happen on first deploy)
git clone $REPO out
cd out
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
Expand All @@ -33,7 +28,8 @@ cd out
git config user.name "Travis CI"
git config user.email "$COMMIT_AUTHOR_EMAIL"

# If there are no changes to the compiled out (e.g. this is a README update) then just bail.
# Do not deploy if there are no changes to the generated out/ .
# (e.g. this is a README update)
git add -A .
git status
if ! git diff --exit-code --quiet; then
Expand All @@ -45,12 +41,13 @@ fi
# The delta will show diffs between new and old versions.
git commit -m "Deploy to GitHub Pages: ${SHA}"

# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
# Decrypt deploy_key.enc using Travis's stored variables
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in $TRAVIS_BUILD_DIR/.ci/deploy_key.enc -out ../deploy_key -d
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV \
-in $TRAVIS_BUILD_DIR/.ci/deploy_key.enc -out ../deploy_key -d
chmod 600 ../deploy_key
eval `ssh-agent -s`
ssh-add ../deploy_key
Expand Down

0 comments on commit e565fd9

Please sign in to comment.