Skip to content

Commit

Permalink
Set up travis to run against all branches (if they are configured).
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutride committed Jul 29, 2016
1 parent 68b157d commit 6b3515c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_js:
- '0.10'

before_install:
- 'git checkout -B master' # Reconcile detached HEAD
- 'git checkout -B $TRAVIS_BRANCH' # Reconcile detached HEAD
- 'if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi'
- 'npm install -g bower grunt-cli'

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ For detailed instructions, please see our [PatternFly Icon Guide](PFICONS.md)

## Tests

The `tests/` directory contains HTML pages with component and pattern examples in order to facilitate development. Please consult the official documentation (see below) for full details on how to use PatternFly.
The `tests/` directory contains HTML pages with component and pattern examples in order to facilitate development. Please consult the official documentation (see below) for full details on how to use PatternFly. The latest PatternFly test directory examples can be seen at [https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/](https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/).

If you are developing on PatternFly and would like to provide a link to a test directory from your fork, TravisCI can be configured to create a copy of your branch with the dist files generated for you. No code changes are necessary to enable this, all that is needed is to login to [TravisCI](https://travis-ci.org/) and configure it to point at your PatternFly fork. The first three steps at their [Getting Started page](https://docs.travis-ci.com/user/for-beginners) provide instructions on how to do this. You will also need to add an AUTH_TOKEN variable to Travis generated in your GitHub account to allow Travis to connect to your fork.

The HTML pages in `dist/tests` are generated using Jekyll. Do *not* edit these files directly. See `tests/pages` to change these files.

Expand Down Expand Up @@ -189,7 +191,7 @@ npm publish

## Documentation

See [https://www.patternfly.org](https://www.patternfly.org) and [http://getbootstrap.com/](http://getbootstrap.com/).
See [https://www.patternfly.org](https://www.patternfly.org) and [http://getbootstrap.com/](http://getbootstrap.com/).

### Browser and Device Support

Expand Down
16 changes: 10 additions & 6 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

set -o errexit -o nounset

if [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master" ]
if [ "$TRAVIS_REPO_SLUG" = "patternfly/patternfly" ]
then
echo "This commit was made against $TRAVIS_BRANCH and not the master or tag! Do not deploy!"
exit 0
echo "This build is running against patternfly/patternfly."
if [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master" ]
then
echo "This commit was made against $TRAVIS_BRANCH and not the master or tag! Do not deploy!"
exit 1
fi
fi

# User info
Expand All @@ -14,13 +18,13 @@ git config user.email "[email protected]"
git config --global push.default simple

# Add upstream authentication token
git remote add upstream https://$AUTH_TOKEN@github.com/patternfly/patternfly.git
git remote add upstream https://$AUTH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git

# Commit generated files
git add dist --force
git commit -m "Added files generated by Travis build"

# Push to releases branch
git push upstream master:releases --force -v
# Push to dist branch
git push upstream $TRAVIS_BRANCH:$TRAVIS_BRANCH-dist --force -v

exit $?
10 changes: 0 additions & 10 deletions tests/index.html

This file was deleted.

0 comments on commit 6b3515c

Please sign in to comment.