File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ <h2>Quickstart with Maven: Add gcloud to your pom.xml</h2>
6262 < pre > <dependency>
6363 <groupId>com.google.gcloud</groupId>
6464 <artifactId>gcloud-java</artifactId>
65- <version>0.0.6 </version>
65+ <version>{{SITE_VERSION}} </version>
6666</dependency></ pre >
6767 </ div > <!-- end of .col.col-right -->
6868 </ div > <!-- end of .container -->
Original file line number Diff line number Diff line change @@ -10,6 +10,28 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" -a "${TRAVIS_BRANCH}" == "master" -
1010 mvn cobertura:cobertura coveralls:report
1111 mvn site-deploy -DskipTests=true --settings=target/travis/settings.xml
1212 mvn deploy -DskipTests=true -Dgpg.skip=true --settings target/travis/settings.xml
13+
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
19+ SITE_VERSION=$( mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev ' (^\[|Download\w+:)' )
20+ if [ " ${SITE_VERSION##* -} " != " SNAPSHOT" ]; then
21+ git checkout gh-pages
22+ mkdir -p site/latest/
23+ touch site/latest/index.html
24+ 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
25+ git add site/latest/index.html
26+
27+ # Update "Quickstart with Maven" block on landing page to reflect latest version
28+ sed -i " s/{{SITE_VERSION}}/$SITE_VERSION /g" site/${SITE_VERSION} /index.html
29+ git add site/${SITE_VERSION} /index.html
30+
31+ git commit -m " Updating to reflect latest website version"
32+ git config --global push.default simple
33+ git push --quiet " https://${CI_DEPLOY_USERNAME} :${CI_DEPLOY_PASSWORD} @github.com/GoogleCloudPlatform/gcloud-java.git" > /dev/null 2>&1
34+ fi
1335else
1436 echo " Not deploying artifacts. This is only done with non-pull-request commits to master branch with Oracle Java 7 builds."
1537fi
You can’t perform that action at this time.
0 commit comments