From 0269b4a8b689d25a2b8304fb62cf3300f10e3f7d Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 29 Aug 2017 14:33:21 +0200 Subject: [PATCH 1/2] Not failing the script if a file can't be added it happens when you want to add a file that is in .gitignore --- docs/src/main/asciidoc/ghpages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh index 3c41f8c2..09435af1 100755 --- a/docs/src/main/asciidoc/ghpages.sh +++ b/docs/src/main/asciidoc/ghpages.sh @@ -184,7 +184,7 @@ function copy_docs_for_current_version() { git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html else cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH} - git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file + git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file || echo "Failed to add the file [$file]" fi fi done From 4d0246d73e28dae272b10f7800c94b0cac9569a4 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Thu, 31 Aug 2017 13:48:43 +0200 Subject: [PATCH 2/2] Started to publish the docs module as a jar without this change we copy paste all the scripts, resources etc. to every single project with this change each project will have this project's resources unpacked in the local `target` directory. The docs generation already reference this changed location so no need to copy paste of any resources is required fixes #60 --- docs/pom.xml | 27 ++++++++++++++++++ docs/src/main/asciidoc/README.adoc | 41 ++++++++++++++++++++++++++ pom.xml | 46 ++++++++++++++++++++++++------ 3 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 docs/pom.xml diff --git a/docs/pom.xml b/docs/pom.xml new file mode 100644 index 00000000..f06d7b57 --- /dev/null +++ b/docs/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + spring-cloud-build-docs + spring-cloud-build-docs + jar + Spring Cloud Build Docs + + org.springframework.cloud + spring-cloud-build + 1.3.5.BUILD-SNAPSHOT + + + + + src/main + + + + + maven-deploy-plugin + 2.8.2 + + + + diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc index 5b78335c..b2e0ac47 100644 --- a/docs/src/main/asciidoc/README.adoc +++ b/docs/src/main/asciidoc/README.adoc @@ -41,3 +41,44 @@ $ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging: == Contributing include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[] + +== Reusing the documentation + +Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains +helpful scripts (e.g. README generation ruby script) and css, xslt and images +for the Spring Cloud documentation. If you want to follow the same convention +approach of generating documentation just add these plugins to your `docs` module + +[source,xml] +---- + + + docs + + + + org.apache.maven.plugins + maven-dependency-plugin <1> + + + org.asciidoctor + asciidoctor-maven-plugin <2> + + + com.agilejava.docbkx + docbkx-maven-plugin <3> + + + org.apache.maven.plugins + maven-antrun-plugin <4> + false + + + + + +---- +<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module +<2> This plugin is required to parse the Asciidoctor documentation +<3> This plugin converts the Asciidoctor documentation into single and multi page docs +<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc diff --git a/pom.xml b/pom.xml index 9f0d3986..36b711ea 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ Spring Cloud Parent Spring Cloud parent pom, managing plugins and dependencies for Spring Cloud projects + docs spring-cloud-build-dependencies spring-cloud-dependencies-parent spring-cloud-build-tools @@ -631,6 +632,33 @@ limitations under the License. + + org.apache.maven.plugins + maven-dependency-plugin + 3.0.0 + + + unpack-docs + generate-resources + + unpack + + + + + org.springframework.cloud + spring-cloud-build-docs + ${spring-cloud-build.version} + sources + jar + false + ${project.build.directory}/build-docs + + + + + + org.asciidoctor asciidoctor-maven-plugin @@ -694,10 +722,10 @@ limitations under the License. ${docs.main}.xml true false - ${basedir}/src/main/docbook/xsl/pdf.xsl + ${project.build.directory}/build-docs/docbook/xsl/pdf.xsl 1 1 - ${basedir}/src/main/docbook/xsl/xslthl-config.xml + ${project.build.directory}/build-docs/docbook/xsl/xslthl-config.xml @@ -722,7 +750,7 @@ limitations under the License. prepare-package - ${basedir}/src/main/docbook/xsl/html-singlepage.xsl + ${project.build.directory}/build-docs/docbook/xsl/html-singlepage.xsl ${basedir}/target/docbook/htmlsingle @@ -731,7 +759,7 @@ limitations under the License. - + @@ -748,7 +776,7 @@ limitations under the License. prepare-package - ${basedir}/src/main/docbook/xsl/html-multipage.xsl + ${project.build.directory}/build-docs/docbook/xsl/html-multipage.xsl ${basedir}/target/docbook/html multi_ @@ -760,7 +788,7 @@ limitations under the License. - + @@ -824,7 +852,7 @@ limitations under the License. - + @@ -840,10 +868,10 @@ limitations under the License. - + - +