Skip to content

Commit

Permalink
fix bower publishing
Browse files Browse the repository at this point in the history
From the Travis CI docs:

http://docs.travis-ci.com/user/ci-environment/

For builds not triggered by a pull request this is the name of the
branch currently being built; whereas for builds triggered by a pull
request this is the name of the branch targeted by the pull request (in
many cases this will be master).

This was building for branches not intended to be published because they
were opened as a pull request against master. As Ember Data core
contributors frequently work off the main repository this is an unwanted
side effect.
  • Loading branch information
Stanley Stuart committed May 24, 2015
1 parent 5cc2859 commit 081f7ce
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bin/bower-ember-data-build
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ USER="rwjblue"
# This ensure that no directories within dist will be copied when script is run.
INCLUDED_FILES=`find dist -maxdepth 1 -type f`

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

echo -e "COMPONENTS_EMBER_REPO_SLUG: ${COMPONENTS_EMBER_REPO_SLUG}\n"
echo -e "INCLUDED_FILES: ${INCLUDED_FILES}\n"
echo -e "CURRENT_BRANCH: ${TRAVIS_BRANCH}\n"
echo -e "CURRENT_BRANCH: ${CURRENT_BRANCH}\n"

if [[ !$GH_TOKEN || $GH_TOKEN == "" ]]; then
echo "secure environment variables not detected."
echo "not a repo owner, exiting."
exit 0
fi

if [[ $TRAVIS_PULL_REQUEST ]]; then
echo "not publishing because this is a pull request."
exit 0
fi

# Set channel to publish to. If no suitable branch is found exit successfully.
case $TRAVIS_BRANCH in
case $CURRENT_BRANCH in
"master" )
CHANNEL="canary" ;;
"beta" )
Expand Down

0 comments on commit 081f7ce

Please sign in to comment.