forked from uber/baseweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): adds more reliable now deploy script (uber#832)
* feat: adds safer now deploy script * fix: adds the master branch filter
- Loading branch information
1 parent
5182de7
commit 5eb983c
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# apt-get install -y jq | ||
|
||
this_commit=$(echo $BUILDKITE_COMMIT | tr -d '"') | ||
tags=$(curl https://api.github.com/repos/uber-web/baseui/git/refs/tags?access_token=${GITHUB_AUTH_TOKEN}) | ||
latest_tagged_commit=$(echo $tags | jq '.[-1].object.sha' | tr -d '"') | ||
|
||
if [ "$this_commit" = "$latest_tagged_commit" ]; then | ||
echo current commit matches latest tagged commit | ||
echo deploying to now... | ||
|
||
yarn documentation:build && | ||
yarn now --team=baseui --token=$ZEIT_NOW_TOKEN && | ||
yarn now alias --team=baseui --token=$ZEIT_NOW_TOKEN && | ||
yarn now rm baseui-documentation --safe --team=baseui --token=$ZEIT_NOW_TOKEN --yes | ||
else | ||
echo current commit does not match latest tagged commit | ||
echo exited without deploying to now | ||
fi |