Skip to content

Commit d2f4128

Browse files
author
Ajay Kannan
committed
Only deploy the site and version updates if not a snapshot release
1 parent 63d01ce commit d2f4128

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

utilities/after_success.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ echo "Travis pull request: " ${TRAVIS_PULL_REQUEST}
88
echo "Travis JDK version: " ${TRAVIS_JDK_VERSION}
99
if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" -a "${TRAVIS_BRANCH}" == "master" -a "${TRAVIS_PULL_REQUEST}" == "false" ]; then
1010
mvn cobertura:cobertura coveralls:report
11-
mvn site-deploy -DskipTests=true --settings=target/travis/settings.xml
1211
mvn deploy -DskipTests=true -Dgpg.skip=true --settings target/travis/settings.xml
1312

14-
# Update "site/latest/index.html" to redirect to the newly generated website (if not a SNAPSHOT)
15-
git config --global user.name "travis-ci"
16-
git config --global user.email "[email protected]"
17-
git clone https://github.com/GoogleCloudPlatform/gcloud-java.git tmp_gh-pages
18-
cd tmp_gh-pages
13+
# Deploy site if not a SNAPSHOT
1914
SITE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)')
2015
if [ "${SITE_VERSION##*-}" != "SNAPSHOT" ]; then
21-
git checkout gh-pages
16+
mvn site-deploy -DskipTests=true --settings=target/travis/settings.xml
17+
18+
# Update "latest" webpage
19+
git config --global user.name "travis-ci"
20+
git config --global user.email "[email protected]"
21+
git clone --branch gh-pages --single-branch https://github.com/GoogleCloudPlatform/gcloud-java/ tmp_gh-pages
22+
cd tmp_gh-pages
2223
mkdir -p site/latest/
2324
touch site/latest/index.html
2425
echo "<html><head><meta http-equiv=\"refresh\" content=\"0; URL='http://GoogleCloudPlatform.github.io/gcloud-java/site/${SITE_VERSION}/index.html'\" /></head><body></body></html>" > site/latest/index.html

0 commit comments

Comments
 (0)