Skip to content

Commit 08e4d5d

Browse files
committed
pr comment
1 parent a0f3786 commit 08e4d5d

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

utilities/create_site.sh

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,24 @@ fi
1515
git clone --branch gh-pages --single-branch https://github.com/GoogleCloudPlatform/google-cloud-java/ tmp_gh-pages
1616
mkdir -p tmp_gh-pages/$SITE_VERSION_BASE
1717
mvn site -DskipTests -Djava.util.logging.config.file=logging.properties
18-
mvn site:stage --quiet -Djava.util.logging.config.file=logging.properties -DtopSiteURL=http://googlecloudplatform.github.io/google-cloud-java/site/${SITE_VERSION_BASE}/
19-
cd tmp_gh-pages
2018

21-
for dir in ../target/staging/*
19+
version_bases=(${SITE_VERSION_BASE} latest)
20+
rm -rf tmp_gh-pages/latest
21+
mkdir tmp_gh-pages/latest
22+
for version_base in ${version_bases[@]}
2223
do
23-
cp -r ${dir}/* $SITE_VERSION_BASE/
24+
mvn site:stage --quiet -Djava.util.logging.config.file=logging.properties -DtopSiteURL=http://googlecloudplatform.github.io/google-cloud-java/site/${version_base}/
25+
cd tmp_gh-pages
26+
cp -r ../target/staging/*/* $version_base
27+
sed -i "s/{{SITE_VERSION}}/$SITE_VERSION/g" ${version_base}/index.html # Update "Quickstart with Maven" to reflect version change
28+
git add $version_base
29+
cd ..
2430
done
2531

26-
sed -i "s/{{SITE_VERSION}}/$SITE_VERSION/g" ${SITE_VERSION_BASE}/index.html # Update "Quickstart with Maven" to reflect version change
27-
git add $SITE_VERSION_BASE
32+
cd tmp_gh-pages
2833
echo "<html><head><meta http-equiv=\"refresh\" content=\"0; URL='http://GoogleCloudPlatform.github.io/google-cloud-java/${SITE_VERSION_BASE}/index.html'\" /></head><body></body></html>" > index.html
2934
git add index.html
3035
echo "<html><head><script>window.location.replace('/google-cloud-java/${SITE_VERSION_BASE}/apidocs' + location.search)</script></head><body></body></html>" > apidocs/index.html
3136
git add apidocs/index.html
3237

33-
cd ..
34-
mvn site:stage --quiet -Djava.util.logging.config.file=logging.properties -DtopSiteURL=http://googlecloudplatform.github.io/google-cloud-java/site/latest/
35-
cd tmp_gh-pages
36-
rm -rf latest
37-
mkdir latest
38-
for dir in ../target/staging/*
39-
do
40-
cp -r ${dir}/* latest/
41-
done
42-
43-
sed -i "s/{{SITE_VERSION}}/$SITE_VERSION/g" latest/index.html # Update "Quickstart with Maven" to reflect version change
44-
git add latest
45-
4638
echo "Site generated under tmp_gh-pages/. The changes must be committed from that directory."

0 commit comments

Comments
 (0)