Skip to content

Commit

Permalink
Add Node 7 testing and prettify output
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Dec 30, 2016
1 parent 55ee566 commit ed08c24
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
node_js:
- "6"
- "7"
cache:
directories:
- node_modules
Expand Down
27 changes: 19 additions & 8 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,37 @@

set -e

# Only run tests for PRs
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "deploy.sh: This is a PR build - only running tests"
function tests {
npm run test-docs
VERSIONED=false npm run web-dist
exit 0
}

function build {
npm run docs
VERSIONED=false npm run web-dist
}

# For PRs or Node 7, only run tests
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "\e[36m\e[4m\e[1mThis is a PR build - only running tests"
tests
fi
if [ "$TRAVIS_NODE_VERSION" != "6" ]; then
echo -e "\e[36m\e[4m\e[1mThis is a Node v$TRAVIS_NODE_VERSION build - only running tests"
tests
fi

# Figure out the source of the build
if [ -n "$TRAVIS_TAG" ]; then
echo "deploy.sh: This is a tag build for $TRAVIS_TAG"
echo -e "\e[36m\e[4m\e[1mThis is a tag build for $TRAVIS_TAG"
SOURCE=$TRAVIS_TAG
else
echo "deploy.sh: This is a branch build for $TRAVIS_BRANCH"
echo -e "\e[36m\e[4m\e[1mThis is a branch build for $TRAVIS_BRANCH"
SOURCE=$TRAVIS_BRANCH
fi

# Build everything
npm run docs
VERSIONED=false npm run web-dist
build

# Initialise some useful variables
REPO=`git config remote.origin.url`
Expand Down

0 comments on commit ed08c24

Please sign in to comment.