From 5a78e62dc0483cc8babb3d44bb637ac785bfff90 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 24 Jan 2019 10:57:01 -0800 Subject: [PATCH] ci: add branch + version metadata to docs deployments --- script/deploy-docs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/script/deploy-docs b/script/deploy-docs index 0f7aa488..16b40c09 100755 --- a/script/deploy-docs +++ b/script/deploy-docs @@ -23,20 +23,23 @@ else mv package.json.tmp package.json fi - now_args="--token=$NOW_TOKEN" - npx commit-status pending docs "deploying v$version docs..." - - echo "deploying..." - now "$now_args" | tee now-url.txt - url=$(cat now-url.txt) - npx commit-status success docs "v$version docs: $url" "$url" - if [[ $TRAVIS_EVENT_TYPE = "pull_request" ]]; then branch=$TRAVIS_PULL_REQUEST_BRANCH else branch=$TRAVIS_BRANCH fi + # add metadata to now deployments so that we can find them more easily + meta_args="-m branch=$branch -m version=$version" + + npx commit-status pending docs "deploying v$version docs..." + + echo "deploying..." + now_args="--token=$NOW_TOKEN" + now "$now_args" "$meta_args" | tee now-url.txt + url=$(cat now-url.txt) + npx commit-status success docs "v$version docs: $url" "$url" + if [[ "$branch" = "master" ]]; then alias=$(jq -r .alias now.json) else