diff options
| author | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
| commit | 60867fb030bae582082340ead7dbc7efdc2f5398 (patch) | |
| tree | 4c6a7356351be2e4914e15c4703172597c45656e /node_modules/snekfetch/scripts | |
| parent | commenting (diff) | |
| download | s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.tar.xz s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.zip | |
2020/04/03, 02:34, v1.2.0
Diffstat (limited to 'node_modules/snekfetch/scripts')
| -rw-r--r-- | node_modules/snekfetch/scripts/travis-deploy.sh | 29 | ||||
| -rw-r--r-- | node_modules/snekfetch/scripts/travis-test.sh | 14 |
2 files changed, 43 insertions, 0 deletions
diff --git a/node_modules/snekfetch/scripts/travis-deploy.sh b/node_modules/snekfetch/scripts/travis-deploy.sh new file mode 100644 index 0000000..5af87dc --- /dev/null +++ b/node_modules/snekfetch/scripts/travis-deploy.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Based on https://github.com/hydrabolt/discord.js-site/blob/master/deploy/deploy.sh + +set -e + +if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "Not building for a non master branch push - building without deploying." + npm run docs + exit 0 +fi + +echo -e "Building for a master branch push - building and deploying." + +REPO=$(git config remote.origin.url) +SHA=$(git rev-parse --verify HEAD) + +TARGET_BRANCH="gh-pages" +git clone $REPO dist -b $TARGET_BRANCH + +npm run docs + +rsync -vau docs/ dist/ + +cd dist +git add --all . +git config user.name "Travis CI" +git config user.email "${COMMIT_EMAIL}" +git commit -m "Docs build: ${SHA}" || true +git push "https://${GH_TOKEN}@${GH_REF}" $TARGET_BRANCH diff --git a/node_modules/snekfetch/scripts/travis-test.sh b/node_modules/snekfetch/scripts/travis-test.sh new file mode 100644 index 0000000..aa4e37d --- /dev/null +++ b/node_modules/snekfetch/scripts/travis-test.sh @@ -0,0 +1,14 @@ +set -e + +npm run lint + +npm run test + +if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "Not sending coverage for a non master branch push - covering without sending." + exit 0 +fi + +echo -e "Generating Coverage for a master branch push - covering and sending." + +npm run test:coveralls |