Skip to content

Commit

Permalink
fix(ci): prevent travis from killing deploy docs job (#1928)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg authored and nnixaa committed Aug 23, 2019
1 parent 90b8fd5 commit 0b969cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
20 changes: 20 additions & 0 deletions scripts/ci/deploy-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
deploy_docs() {
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then
npm run docs:gh-pages &

# https://github.com/travis-ci/travis-ci/issues/4190#issuecomment-169987525
minutes=0
limit=30
while kill -0 $! >/dev/null 2>&1; do
echo -n -e " \b"

if [ $minutes == $limit ]; then
break;
fi

minutes=$((minutes+1))

sleep 60
done
fi
}
5 changes: 2 additions & 3 deletions scripts/ci/travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ source ./scripts/ci/tunnel.sh
source ./scripts/ci/publish.sh
source ./scripts/ci/deploy.sh
source ./scripts/ci/packages-smoke.sh
source ./scripts/ci/deploy-docs.sh

if [[ -z "$TRAVIS" ]]; then
echo "This script can only run inside of Travis build jobs."
Expand All @@ -31,9 +32,7 @@ elif [[ "${MODE}" = deploy_dev ]]; then
elif [[ "${MODE}" = publish_dev ]]; then
publish_dev
elif [[ "${MODE}" = deploy_docs ]]; then
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then
npm run docs:gh-pages
fi
deploy_docs
exit 0
fi

Expand Down

0 comments on commit 0b969cb

Please sign in to comment.