Skip to content

Commit 9d3b525

Browse files
committed
Merge pull request #151 from ajkannan/modify-site-generation
Push to gh-pages without using maven's site-deploy
2 parents 9253778 + c0cadb7 commit 9d3b525

File tree

2 files changed

+11
-33
lines changed

2 files changed

+11
-33
lines changed

pom.xml

+1-20
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<site>
5151
<id>github-pages-site</id>
5252
<name>Deployment through GitHub's site deployment plugin</name>
53-
<url>site/${project.version}/</url>
53+
<url>${project.version}/</url>
5454
</site>
5555
</distributionManagement>
5656
<licenses>
@@ -372,25 +372,6 @@
372372
</reportPlugins>
373373
</configuration>
374374
</plugin>
375-
<plugin>
376-
<groupId>com.github.github</groupId>
377-
<artifactId>site-maven-plugin</artifactId>
378-
<version>0.12</version>
379-
<configuration>
380-
<message>Creating site for ${project.artifactId} ${project.version}</message>
381-
<path>${project.distributionManagement.site.url}</path>
382-
<merge>true</merge>
383-
</configuration>
384-
<executions>
385-
<execution>
386-
<id>github-site</id>
387-
<goals>
388-
<goal>site</goal>
389-
</goals>
390-
<phase>site-deploy</phase>
391-
</execution>
392-
</executions>
393-
</plugin>
394375
</plugins>
395376
</build>
396377
</project>

utilities/after_success.sh

+10-13
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,22 @@ 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
1111

12-
# Deploy site if not a SNAPSHOT
1312
SITE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)')
1413
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
1815
git config --global user.name "travis-ci"
1916
git config --global user.email "[email protected]"
2017
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}/
2121
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."
3128
git config --global push.default simple
3229
git push --quiet "https://${CI_DEPLOY_USERNAME}:${CI_DEPLOY_PASSWORD}@github.com/GoogleCloudPlatform/gcloud-java.git" > /dev/null 2>&1
3330
else

0 commit comments

Comments
 (0)