diff --git a/.travis.yml b/.travis.yml index 88dd5093..bb7047c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ script: after_success: - go get github.com/mattn/goveralls - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci - - site/build-and-publish.sh + - test "${TRAVIS_PULL_REQUEST}" = "false" && site/build-and-publish.sh diff --git a/site/build-and-publish.sh b/site/build-and-publish.sh index 41961ac1..81867e7c 100755 --- a/site/build-and-publish.sh +++ b/site/build-and-publish.sh @@ -6,9 +6,13 @@ cd $(dirname $0)/ BRANCH=${TRAVIS_BRANCH:-`git rev-parse --abbrev-ref @`} COMMIT=${TRAVIS_COMMIT:-`git rev-parse @`} +OUTPUT="weave/${BRANCH}/${COMMIT}" -export BRANCH COMMIT +export BRANCH COMMIT OUTPUT bundle install --path=.bundle bundle exec jekyll build --verbose -gsutil -m cp -z html,css -a public-read -R _site gs://docs.weave.works/weave/${BRANCH}/${COMMIT} + +gsutil -m cp -z html,css -a public-read -R _site "gs://docs.weave.works/${OUTPUT}" + +echo "Published at http://docs.weave.works/${OUTPUT}"