1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 11:17:05 +03:00
css/script/cibuild

32 lines
868 B
Plaintext
Raw Normal View History

2017-07-08 05:59:11 +03:00
#!/bin/bash
2017-07-08 01:57:33 +03:00
set -e
2017-07-08 02:00:22 +03:00
# --yes gets passed in by .travis.yml,
# which makes this easier to test locally
args=$@
2017-07-11 01:48:41 +03:00
branch=$TRAVIS_BRANCH
2017-07-21 02:49:22 +03:00
# the presence of $TRAVIS_PULL_REQUEST_BRANCH tells us
# whether this is a pull request
if [[ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]]; then
target_branch=$TRAVIS_PULL_REQUEST_BRANCH
2017-07-25 20:32:15 +03:00
# if the *source* branch begins with "release"
if [[ "$branch" =~ ^release ]]; then
script/release-candidate $args
2017-07-25 20:32:15 +03:00
# otherwise, if the *target* branch is dev
elif [[ "$target_branch" = "dev" ]]; then
script/release-pr $args
2017-07-25 20:32:15 +03:00
else
echo "⚠️ This is a PR, but '$branch' isn't a release branch"
echo " and '$target_branch' isn't a recognized target branch."
exit 1
fi
2017-07-21 03:08:47 +03:00
elif [[ "$branch" = "master" ]]; then
2017-07-21 01:21:59 +03:00
script/release $args
2017-07-08 01:57:33 +03:00
else
2017-07-21 03:08:47 +03:00
echo "⚠️ This isn't a PR and '$branch' isn't a release branch."
2017-07-08 01:57:33 +03:00
exit 1
fi
2017-07-25 20:32:15 +03:00