@@ -9,25 +9,22 @@ echo "Travis JDK version: " ${TRAVIS_JDK_VERSION}
9
9
if [ " ${TRAVIS_JDK_VERSION} " == " oraclejdk7" -a " ${TRAVIS_BRANCH} " == " master" -a " ${TRAVIS_PULL_REQUEST} " == " false" ]; then
10
10
mvn cobertura:cobertura coveralls:report
11
11
12
- # Deploy site if not a SNAPSHOT
13
12
SITE_VERSION=$( mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev ' (^\[|\w+:)' )
14
13
if [ " ${SITE_VERSION##* -} " != " SNAPSHOT" ]; then
15
- mvn site-deploy -DskipTests=true --settings=target/travis/settings.xml
16
-
17
- # Update "latest" webpage
14
+ # Deploy site if not a SNAPSHOT
18
15
git config --global user.name " travis-ci"
19
16
git config --global user.email
" [email protected] "
20
17
git clone --branch gh-pages --single-branch https://github.com/GoogleCloudPlatform/gcloud-java/ tmp_gh-pages
18
+ mkdir -p tmp_gh-pages/$SITE_VERSION
19
+ mvn site -DskipTests=true
20
+ mvn site:stage -DtopSiteURL=http://googlecloudplatform.github.io/gcloud-java/site/${SITE_VERSION} /
21
21
cd tmp_gh-pages
22
- mkdir -p site/latest/
23
- 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
24
- git add site/latest/index.html
25
-
26
- # Update "Quickstart with Maven" block on landing page to reflect latest version
27
- sed -i " s/{{SITE_VERSION}}/$SITE_VERSION /g" site/${SITE_VERSION} /index.html
28
- git add site/${SITE_VERSION} /index.html
29
-
30
- git commit -m " Update the redirect in 'latest/index.html' and the version in the 'Quickstart with Maven' landing page box to $SITE_VERSION "
22
+ cp -r ../target/staging/$SITE_VERSION /* $SITE_VERSION /
23
+ sed -i " s/{{SITE_VERSION}}/$SITE_VERSION /g" ${SITE_VERSION} /index.html # Update "Quickstart with Maven" to reflect version change
24
+ git add $SITE_VERSION
25
+ echo " <html><head><meta http-equiv=\" refresh\" content=\" 0; URL='http://GoogleCloudPlatform.github.io/gcloud-java/${SITE_VERSION} /index.html'\" /></head><body></body></html>" > index.html
26
+ git add index.html
27
+ git commit -m " Added a new site for version $SITE_VERSION and updated the root directory's redirect."
31
28
git config --global push.default simple
32
29
git push --quiet " https://${CI_DEPLOY_USERNAME} :${CI_DEPLOY_PASSWORD} @github.com/GoogleCloudPlatform/gcloud-java.git" > /dev/null 2>&1
33
30
else
0 commit comments