From 6b3515c60dbe0e0b41802016a06e573a699ac85d Mon Sep 17 00:00:00 2001 From: Dana Gutride Date: Thu, 28 Jul 2016 11:30:40 -0400 Subject: [PATCH] Set up travis to run against all branches (if they are configured). --- .travis.yml | 2 +- README.md | 6 ++++-- scripts/publish.sh | 16 ++++++++++------ tests/index.html | 10 ---------- 4 files changed, 15 insertions(+), 19 deletions(-) delete mode 100644 tests/index.html diff --git a/.travis.yml b/.travis.yml index e293aba118..036c0eace0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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' diff --git a/README.md b/README.md index d47a77e24b..6bb91f96b4 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 diff --git a/scripts/publish.sh b/scripts/publish.sh index ee460d629c..b6d52e56d5 100644 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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 @@ -14,13 +18,13 @@ git config user.email "patternfly@redhat.com" 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 $? diff --git a/tests/index.html b/tests/index.html deleted file mode 100644 index f945cf866e..0000000000 --- a/tests/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - PatternFly tests - - - -
The contents you are looking for have moved. Redirecting to new location... -
- -