From e7b3617ccaba11f3708084dd8740a17f910ddde2 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Thu, 11 Jul 2019 17:00:45 +0200 Subject: [PATCH 01/10] WIP --- pom.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 003bf7fb..90b417f9 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ 0.1.0.RELEASE 1.5.0-alpha.16 + 1.5.18 ${project.version} deploy @@ -999,10 +1000,17 @@ asciidoctorj-pdf ${asciidoctorj-pdf.version} + + org.asciidoctor + asciidoctorj-diagram + ${asciidoctorj-diagram.version} + ${project.build.directory}/refdocs/ - ${docs.main}.adoc + + asciidoctor-diagram + @@ -1031,7 +1039,6 @@ ${project.version} true - ${docs.main}.html From eafe8ff0670294464c9dc937278b9f8647bde018 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 16 Jul 2019 17:05:16 +0200 Subject: [PATCH 02/10] single / multi and pdf added --- pom.xml | 215 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 161 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index 90b417f9..72231a35 100644 --- a/pom.xml +++ b/pom.xml @@ -31,13 +31,17 @@ 2.2.0.M4 2.2.0.BUILD-SNAPSHOT ${project.build.directory}/build-docs + ${project.build.directory}/refdocs/ 0.1.0.RELEASE - 0.1.0.RELEASE + 0.1.3.RELEASE - 1.5.0-alpha.16 + 1.5.0-alpha.18 1.5.18 ${project.version} deploy + ${project.version} + 1.5.8 + 9.2.7.0 jacoco @@ -954,7 +958,7 @@ ${spring-doc-resources.version} zip true - ${project.build.directory}/refdocs/ + ${refdocs.build.directory} @@ -1007,7 +1011,23 @@ - ${project.build.directory}/refdocs/ + ${refdocs.build.directory} + + + ${refdocs.build.directory} + + **/*.*adoc + + + + + ${project.basedir}/src + ${project.basedir}/src/main/asciidoc + ${project.basedir}/target/generated-resources + ${github-tag} + ${version-type} + ${project.version} + asciidoctor-diagram @@ -1021,34 +1041,96 @@ html5 + + adoc + htmladoc + + ${project.build.directory}/generated-docs/reference/html highlight.js book - // these attributes are required to use the doc resources - shared - css/ - spring.css - true - font js/highlight atom-one-dark-reasonable + true + ./images + font + css/ + spring.css + warn + + true - left - 4 ${project.version} - true + ${revision} + ${project.version} + ${github-tag} + + + true + + + + + + + + generate-htmlsingle-documentation + prepare-package + + process-asciidoc + + + html5 + + htmlsingleadoc + + ${project.build.directory}/generated-docs/reference/htmlsingle + highlight.js + book + + js/highlight + atom-one-dark-reasonable + true + ./images + font + css/ + spring.css + + + true + + ${project.version} + ${revision} + ${project.version} + ${github-tag} + + generate-pdf-documentation + prepare-package + + process-asciidoc + + + pdf + + pdfadoc + + ${project.build.directory}/generated-docs/reference/pdf + + + ${refdocs.build.directory} + + **/* + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - ${build-helper-maven-plugin.version} - false - org.apache.maven.plugins maven-antrun-plugin @@ -1078,12 +1160,12 @@ org.jruby jruby-complete - 1.7.17 + ${jruby-complete.version} org.asciidoctor asciidoctorj - 1.5.8 + ${asciidoctorj.version} @@ -1126,6 +1208,25 @@ + + package-and-attach-docs-zip + package + + run + + + + + + + + + + + setup-maven-properties validate @@ -1135,48 +1236,54 @@ true - - - - - + + + + + - - - + - - + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build-helper-maven-plugin.version} + false + + + attach-zip + + attach-artifact + + + + + + ${project.build.directory}/${project.artifactId}-${project.version}.zip + + zip + + + + + + org.jfrog.buildinfo artifactory-maven-plugin From 3673bb894486d9d37a2742d68141655d6855a929 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Thu, 18 Jul 2019 14:16:07 +0200 Subject: [PATCH 03/10] Added git info to docs --- docs/pom.xml | 4 ++ docs/src/main/asciidoc/README.adoc | 23 ++++--- pom.xml | 104 +++++++++++++++++++++-------- 3 files changed, 96 insertions(+), 35 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 6ac92fc8..25892558 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -36,6 +36,10 @@ docs + + pl.project13.maven + git-commit-id-plugin + org.apache.maven.plugins maven-dependency-plugin diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc index 540122cc..9c861347 100644 --- a/docs/src/main/asciidoc/README.adoc +++ b/docs/src/main/asciidoc/README.adoc @@ -57,30 +57,35 @@ approach of generating documentation just add these plugins to your `docs` modul - org.apache.maven.plugins - maven-dependency-plugin <1> + pl.project13.maven + git-commit-id-plugin <1> org.apache.maven.plugins - maven-resources-plugin <2> + maven-dependency-plugin <2> + + + org.apache.maven.plugins + maven-resources-plugin <3> org.asciidoctor - asciidoctor-maven-plugin <3> + asciidoctor-maven-plugin <4> org.apache.maven.plugins - maven-antrun-plugin <4> + maven-antrun-plugin <5> ---- -<1> This plugin downloads the resources of the `spring-cloud-build-docs` module -<2> This plugin unpacks the resources of the `spring-cloud-build-docs` module -<3> This plugin is required to parse the Asciidoctor documentation -<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links +<2> This plugin downloads sets up all the git information of the project +<2> This plugin downloads the resources of the `spring-cloud-build-docs` module +<3> This plugin unpacks the resources of the `spring-cloud-build-docs` module +<4> This plugin is required to parse the Asciidoctor documentation +<5> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links IMPORTANT: The order of plugin declaration is important! diff --git a/pom.xml b/pom.xml index 72231a35..6f94d5ff 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 3.2.2 1.6.0 3.1.0 - 2.2.4 + 3.0.0 3.1.1 3.0.0-M2 1.6 @@ -486,6 +486,7 @@ ${project.build.outputDirectory}/git.properties + false @@ -1023,9 +1024,23 @@ ${project.basedir}/src ${project.basedir}/src/main/asciidoc - ${project.basedir}/target/generated-resources + ${project.basedir}/target/generated-resources + + ${docs.main} + https://raw.github.com/${docs.main}/${github-tag} + https://github.com/${docs.main}/tree/${github-tag} + https://github.com/${docs.main}/issues/ + https://github.com/${docs.main}/wiki + https://github.com/${docs.main}/tree/master + + + true + + ${project.version} ${github-tag} ${version-type} + ${docs-url} + ${raw-docs-url} ${project.version} @@ -1045,7 +1060,8 @@ adoc htmladoc - ${project.build.directory}/generated-docs/reference/html + ${project.build.directory}/generated-docs/reference/html + highlight.js book @@ -1057,19 +1073,11 @@ css/ spring.css warn - - - true - - ${project.version} - ${revision} - ${project.version} - ${github-tag} true - + @@ -1085,7 +1093,9 @@ htmlsingleadoc - ${project.build.directory}/generated-docs/reference/htmlsingle + + ${project.build.directory}/generated-docs/reference/htmlsingle + highlight.js book @@ -1096,14 +1106,6 @@ font css/ spring.css - - - true - - ${project.version} - ${revision} - ${project.version} - ${github-tag} @@ -1118,7 +1120,8 @@ pdfadoc - ${project.build.directory}/generated-docs/reference/pdf + ${project.build.directory}/generated-docs/reference/pdf + ${refdocs.build.directory} @@ -1221,7 +1224,7 @@ - + @@ -1252,9 +1255,58 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 181fb388fcb137f408c5038ad469db7aca626538 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 19 Jul 2019 17:39:52 +0200 Subject: [PATCH 04/10] docs urls, links set from props --- pom.xml | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 6f94d5ff..9910c71e 100644 --- a/pom.xml +++ b/pom.xml @@ -1032,6 +1032,7 @@ https://github.com/${docs.main}/issues/ https://github.com/${docs.main}/wiki https://github.com/${docs.main}/tree/master + ${index-link} true @@ -1041,7 +1042,8 @@ ${version-type} ${docs-url} ${raw-docs-url} - ${project.version} + ${project.version} + ${docs.main} asciidoctor-diagram @@ -1263,6 +1265,13 @@ + + + + + + @@ -1272,6 +1281,15 @@ + + + + + + + + @@ -1280,24 +1298,8 @@ - - - - - - - - - - - - - - - + From a3874d2c624f6396ce206b1f83154f186ad7c0b4 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Sat, 20 Jul 2019 11:39:06 +0200 Subject: [PATCH 05/10] Fixed extensions --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9910c71e..e4525b9e 100644 --- a/pom.xml +++ b/pom.xml @@ -1059,8 +1059,8 @@ html5 - adoc - htmladoc + .adoc + .htmladoc ${project.build.directory}/generated-docs/reference/html @@ -1093,7 +1093,7 @@ html5 - htmlsingleadoc + .htmlsingleadoc ${project.build.directory}/generated-docs/reference/htmlsingle @@ -1120,7 +1120,7 @@ pdf - pdfadoc + .pdfadoc ${project.build.directory}/generated-docs/reference/pdf From 2a25b01f99e4dcb5d988c4855acb82954245e837 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 22 Jul 2019 15:11:36 +0200 Subject: [PATCH 06/10] Added readme --- README.adoc | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.adoc b/README.adoc index 070625ee..287c11b1 100644 --- a/README.adoc +++ b/README.adoc @@ -179,6 +179,7 @@ $ touch .springformat ==== Intellij IDEA In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin. +The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project. .spring-cloud-build-tools/ ---- @@ -240,30 +241,35 @@ approach of generating documentation just add these plugins to your `docs` modul - org.apache.maven.plugins - maven-dependency-plugin <1> + pl.project13.maven + git-commit-id-plugin <1> org.apache.maven.plugins - maven-resources-plugin <2> + maven-dependency-plugin <2> + + + org.apache.maven.plugins + maven-resources-plugin <3> org.asciidoctor - asciidoctor-maven-plugin <3> + asciidoctor-maven-plugin <4> org.apache.maven.plugins - maven-antrun-plugin <4> + maven-antrun-plugin <5> ---- -<1> This plugin downloads the resources of the `spring-cloud-build-docs` module -<2> This plugin unpacks the resources of the `spring-cloud-build-docs` module -<3> This plugin is required to parse the Asciidoctor documentation -<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links +<2> This plugin downloads sets up all the git information of the project +<2> This plugin downloads the resources of the `spring-cloud-build-docs` module +<3> This plugin unpacks the resources of the `spring-cloud-build-docs` module +<4> This plugin is required to parse the Asciidoctor documentation +<5> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links IMPORTANT: The order of plugin declaration is important! @@ -294,4 +300,6 @@ $ ./mvnw clean deploy -Pguides what will happen is that for GA project versions, we will clone `gs-guide1`, `gs-guide2` and `gs-guide3` and update their contents with the ones being under your `guides` project. -You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on. \ No newline at end of file +You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on. + +You can configure the project version passed to guides via the `guides-project.version` (defaults to `${project.version}`). The phase at which guides get updated can be configured by `guides-update.phase` (defaults to `deploy`). \ No newline at end of file From 1b8e3471c0e2b2d4a2903ba62630eebb52227617 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 22 Jul 2019 16:40:37 +0200 Subject: [PATCH 07/10] index.html is a normal page --- docs/src/main/asciidoc/ghpages.sh | 26 +------------ docs/src/test/bats/ghpages.bats | 63 +------------------------------ pom.xml | 30 ++------------- 3 files changed, 8 insertions(+), 111 deletions(-) diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh index 8d315164..1e5b9d90 100755 --- a/docs/src/main/asciidoc/ghpages.sh +++ b/docs/src/main/asciidoc/ghpages.sh @@ -121,14 +121,6 @@ function retrieve_doc_properties() { echo "Will not extract any properties for release train" return fi - echo "Extracting doc properties" - MAIN_ADOC_VALUE=$("${MAVEN_EXEC}" -q \ - -Dexec.executable="echo" \ - -Dexec.args='${docs.main}' \ - org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ - -P docs \ - -pl docs | tail -1 ) - echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]" WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"} @@ -226,15 +218,8 @@ function copy_docs_for_current_version() { echo "The file [${file}] shouldn't be ignored" # Not ignored... # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html - if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then - # We don't want to copy the spring-cloud-sleuth.html - # we want it to be converted to index.html - cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html" - "${GIT_BIN}" add -A "${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html" - else - cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}" + cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}" "${GIT_BIN}" add -A "${ROOT_FOLDER}/${CURRENT_BRANCH}/${file}" || echo "Failed to add the file [${file}]" - fi fi done COMMIT_CHANGES="yes" @@ -268,14 +253,7 @@ function copy_docs_for_branch() { echo "Copying file [${file}] to destination [${destination}]" if ! "${GIT_BIN}" ls-files -i -o --exclude-standard --directory | grep -q ^"${file}"$; then # Not ignored... - # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html - if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then - # We don't want to copy the spring-cloud-sleuth.html - # we want it to be converted to index.html - cp -rf "${f}" "${destination}"/index.html - else - cp -rf "${f}" "${destination}" - fi + cp -rf "${f}" "${destination}" "${GIT_BIN}" add -A "${destination}" fi } diff --git a/docs/src/test/bats/ghpages.bats b/docs/src/test/bats/ghpages.bats index 4ff14167..cb4053bc 100644 --- a/docs/src/test/bats/ghpages.bats +++ b/docs/src/test/bats/ghpages.bats @@ -88,7 +88,6 @@ export -f stubbed_git export RELEASER_GIT_OAUTH_TOKEN="mytoken" cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html touch docs/target/generated-docs/foo.html run "${SOURCE_DIR}"/ghpages.sh @@ -118,7 +117,6 @@ export -f stubbed_git cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html touch docs/target/generated-docs/foo.html run "${SOURCE_DIR}"/ghpages.sh @@ -130,7 +128,6 @@ export -f stubbed_git # Previous branch was [master] assert_output --partial "git checkout master" assert_output --partial "git checkout v1.0.0.RELEASE" - assert_output --partial "Extracted 'main.adoc' from Maven build [home]" assert_output --partial "git stash" assert_output --partial "git checkout gh-pages" assert_output --partial "git pull origin gh-pages" @@ -154,7 +151,6 @@ export -f stubbed_git cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html touch docs/target/generated-docs/foo.html run "${SOURCE_DIR}"/ghpages.sh @@ -308,7 +304,6 @@ export -f stubbed_git retrieve_doc_properties assert_success - assert [ "${MAIN_ADOC_VALUE}" == "home" ] assert [ "${WHITELISTED_BRANCHES_VALUE}" == "0.1.1.RELEASE" ] } @@ -341,7 +336,6 @@ export -f stubbed_git export CURRENT_BRANCH="master" cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html touch docs/target/generated-docs/foo.html source "${SOURCE_DIR}"/ghpages.sh @@ -356,10 +350,9 @@ export -f stubbed_git export GIT_BIN="printing_git" export CURRENT_BRANCH="present" export WHITELISTED_BRANCHES_VALUE="present" - export MAIN_ADOC_VALUE="my_doc" cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html + touch docs/target/generated-docs/my_doc.html touch docs/target/generated-docs/foo.html source "${SOURCE_DIR}"/ghpages.sh @@ -372,7 +365,7 @@ export -f stubbed_git run copy_docs_for_current_version assert_success - assert_output --partial "add -A ${ROOT_FOLDER}/present/index.html" + assert_output --partial "add -A ${ROOT_FOLDER}/present/my_doc.html" assert_output --partial "add -A ${ROOT_FOLDER}/present/foo.html" } @@ -389,58 +382,6 @@ export -f stubbed_git assert [ "${COMMIT_CHANGES}" != "yes" ] } -@test "should reuse main adoc value as new index.html" { - export GIT_BIN="printing_git" - export DESTINATION_REPO_FOLDER="${TEMP_DIR}/spring-cloud-static" - export VERSION="1.0.0.RELEASE" - export MAIN_ADOC_VALUE="my_doc" - cd "${TEMP_DIR}/spring-cloud-stream/" - mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html - touch docs/target/generated-docs/foo.html - - source "${SOURCE_DIR}"/ghpages.sh - - copy_docs_for_provided_version - - assert_success - assert [ "${COMMIT_CHANGES}" == "yes" ] - assert [ "${CURRENT_BRANCH}" == "v${VERSION}" ] - - run copy_docs_for_provided_version - - assert_success - assert_output --partial "add -A ${DESTINATION_REPO_FOLDER}/${VERSION}" - assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/index.html" ] - assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/foo.html" ] -} - -@test "should reuse repo name as new index.html" { - export GIT_BIN="printing_git" - export DESTINATION_REPO_FOLDER="${TEMP_DIR}/spring-cloud-static" - export VERSION="1.0.0.RELEASE" - export REPO_NAME="spring-cloud-stream" - cd "${TEMP_DIR}/spring-cloud-stream/" - mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/${REPO_NAME}.html - touch docs/target/generated-docs/foo.html - - source "${SOURCE_DIR}"/ghpages.sh - - copy_docs_for_provided_version - - assert_success - assert [ "${COMMIT_CHANGES}" == "yes" ] - assert [ "${CURRENT_BRANCH}" == "v${VERSION}" ] - - run copy_docs_for_provided_version - - assert_success - assert_output --partial "add -A ${DESTINATION_REPO_FOLDER}/${VERSION}" - assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/index.html" ] - assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/foo.html" ] -} - @test "should not do anything if commit flag not set" { export GIT_BIN="printing_git_with_remotes" export COMMIT_CHANGES="no" diff --git a/pom.xml b/pom.xml index e4525b9e..4369931c 100644 --- a/pom.xml +++ b/pom.xml @@ -96,6 +96,8 @@ 0.0.2.RELEASE true + 3.2.10 + 1.8.1 @@ -1155,12 +1157,12 @@ org.apache.ant ant-nodeps - 1.8.1 + ${ant-nodeps.version} org.tigris.antelope antelopetasks - 3.2.10 + ${antelopetasks.version} org.jruby @@ -1265,13 +1267,6 @@ - - - - - - @@ -1281,15 +1276,6 @@ - - - - - - - - @@ -1298,14 +1284,6 @@ - - - - - - - From e96bbbdda17d1c7c4a6820f17dffc738cb6662f5 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 22 Jul 2019 17:34:00 +0200 Subject: [PATCH 08/10] Fixed invalid reference to spring-cloud raw github links --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 4369931c..7240c3d5 100644 --- a/pom.xml +++ b/pom.xml @@ -1029,11 +1029,11 @@ ${project.basedir}/target/generated-resources ${docs.main} - https://raw.github.com/${docs.main}/${github-tag} - https://github.com/${docs.main}/tree/${github-tag} - https://github.com/${docs.main}/issues/ - https://github.com/${docs.main}/wiki - https://github.com/${docs.main}/tree/master + https://raw.github.com/spring-cloud/${docs.main}/${github-tag} + https://github.com/spring-cloud/${docs.main}/tree/${github-tag} + https://github.com/spring-cloud/${docs.main}/issues/ + https://github.com/spring-cloud/${docs.main}/wiki + https://github.com/spring-cloud/${docs.main}/tree/master ${index-link} From 6176fb3ba783fcbd50a1b89157d5f947a61a09fb Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 23 Jul 2019 13:12:06 +0200 Subject: [PATCH 09/10] Added project root attribute --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 7240c3d5..42474c4b 100644 --- a/pom.xml +++ b/pom.xml @@ -1028,6 +1028,7 @@ ${project.basedir}/src/main/asciidoc ${project.basedir}/target/generated-resources + ${maven.multiModuleProjectDirectory} ${docs.main} https://raw.github.com/spring-cloud/${docs.main}/${github-tag} https://github.com/spring-cloud/${docs.main}/tree/${github-tag} From fb4e94d07c71d9cd8f3407e1b9c1ecdc22602ab3 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 26 Jul 2019 14:56:43 +0200 Subject: [PATCH 10/10] Changes following review --- docs/src/test/bats/ghpages.bats | 42 +++++++++++++-------------- docs/src/test/bats/update-guides.bats | 8 ++--- pom.xml | 8 +++-- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/docs/src/test/bats/ghpages.bats b/docs/src/test/bats/ghpages.bats index 87b54b55..5c5a13f9 100644 --- a/docs/src/test/bats/ghpages.bats +++ b/docs/src/test/bats/ghpages.bats @@ -36,7 +36,7 @@ function git_with_remotes { if [[ "$*" == *"set-url"* ]]; then echo "git $*" elif [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" else git $* fi @@ -56,7 +56,7 @@ function printing_git_failing_with_diff_index { function printing_git_with_remotes { if [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" else printing_git $* fi @@ -64,7 +64,7 @@ function printing_git_with_remotes { function stubbed_git { if [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" elif [[ "$*" == *"diff-index"* ]]; then return 1 elif [[ "$*" == *"symbolic-ref"* ]]; then @@ -88,12 +88,12 @@ export -f stubbed_git export RELEASER_GIT_OAUTH_TOKEN="mytoken" cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/foo.html + touch docs/target/generated-docs/example1.html run "${SOURCE_DIR}"/ghpages.sh assert_success - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git fetch -q" assert_output --partial "git checkout master" assert_output --partial "git stash" @@ -102,7 +102,7 @@ export -f stubbed_git # Current branch is master - will copy the current docs only to the root folder assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-stream" assert_output --partial "git commit -a -m Sync docs from master to gh-pages" - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git push origin gh-pages" assert_output --partial "git checkout master" assert_output --partial "git stash pop" @@ -117,12 +117,12 @@ export -f stubbed_git cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/foo.html + touch docs/target/generated-docs/example1.html run "${SOURCE_DIR}"/ghpages.sh assert_success - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git remote set-branches --add origin gh-pages" assert_output --partial "git fetch -q" # Previous branch was [master] @@ -132,10 +132,10 @@ export -f stubbed_git assert_output --partial "git checkout gh-pages" assert_output --partial "git pull origin gh-pages" # Current branch is master - will copy the current docs only to the root folder - assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/foo.html" ] + assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/example1.html" ] assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}" assert_output --partial "git commit -a -m Sync docs from v1.0.0.RELEASE to gh-pages" - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git push origin gh-pages" assert_output --partial "git checkout master" assert_output --partial "git stash pop" @@ -151,22 +151,22 @@ export -f stubbed_git cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/foo.html + touch docs/target/generated-docs/example1.html run "${SOURCE_DIR}"/ghpages.sh assert_success - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" # Previous branch was [master] assert_output --partial "git checkout master" assert_output --partial "git stash" assert_output --partial "git checkout gh-pages" assert_output --partial "git pull origin gh-pages" # Current branch is master - will copy the current docs only to the root folder - assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/foo.html" ] + assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/example1.html" ] assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/${VERSION}" assert_output --partial "git commit -a -m Sync docs from vGreenwich.SR2 to gh-pages" - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git push origin gh-pages" assert_output --partial "git checkout master" assert_output --partial "git stash pop" @@ -197,7 +197,7 @@ export -f stubbed_git run add_oauth_token_to_remote_url assert_success - assert_output --partial "git remote set-url --push origin https://foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://example1.example2/example3.git" } @test "should add auth token to URL if token is present" { @@ -210,7 +210,7 @@ export -f stubbed_git run add_oauth_token_to_remote_url assert_success - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" } @test "should retrieve the name of the current branch" { @@ -322,7 +322,7 @@ export -f stubbed_git export CURRENT_BRANCH="master" cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ - touch docs/target/generated-docs/foo.html + touch docs/target/generated-docs/example1.html source "${SOURCE_DIR}"/ghpages.sh @@ -339,7 +339,7 @@ export -f stubbed_git cd "${TEMP_DIR}/spring-cloud-stream/" mkdir -p docs/target/generated-docs/ touch docs/target/generated-docs/my_doc.html - touch docs/target/generated-docs/foo.html + touch docs/target/generated-docs/example1.html source "${SOURCE_DIR}"/ghpages.sh @@ -352,7 +352,7 @@ export -f stubbed_git assert_success assert_output --partial "add -A ${ROOT_FOLDER}/present/my_doc.html" - assert_output --partial "add -A ${ROOT_FOLDER}/present/foo.html" + assert_output --partial "add -A ${ROOT_FOLDER}/present/example1.html" } @test "should do nothing if current branch is not whitelisted" { @@ -391,7 +391,7 @@ export -f stubbed_git assert_success assert_output --partial "git commit -a -m Sync docs from to gh-pages" - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" assert_output --partial "git push origin gh-pages" } @@ -407,7 +407,7 @@ export -f stubbed_git assert_success assert_output --partial "git commit -a -m Sync docs from to gh-pages" - assert_output --partial "git remote set-url --push origin https://username:password@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://username:password@example1.example2/example3.git" assert_output --partial "git push origin gh-pages" } diff --git a/docs/src/test/bats/update-guides.bats b/docs/src/test/bats/update-guides.bats index bd804cf9..fc7871bc 100644 --- a/docs/src/test/bats/update-guides.bats +++ b/docs/src/test/bats/update-guides.bats @@ -33,7 +33,7 @@ function git_with_remotes { if [[ "$*" == *"set-url"* ]]; then echo "git $*" elif [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" else git $* fi @@ -45,7 +45,7 @@ function printing_git { function printing_git_with_remotes { if [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" else printing_git $* fi @@ -53,7 +53,7 @@ function printing_git_with_remotes { function stubbed_git { if [[ "$*" == *"config remote.origin.url"* ]]; then - echo "git://foo.bar/baz.git" + echo "git://example1.example2/example3.git" elif [[ "$*" == *"commit"* ]]; then printing_git $* elif [[ "$*" == *"push"* ]]; then @@ -111,7 +111,7 @@ export -f stubbed_git assert_success # change remote - assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git" + assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git" # commit and push assert_output --partial "git commit -m Updating guides" assert_output --partial "git push origin master" diff --git a/pom.xml b/pom.xml index daf606d5..c5cddbb9 100644 --- a/pom.xml +++ b/pom.xml @@ -1024,6 +1024,12 @@ + shared + true + + left + 4 + true ${project.basedir}/src ${project.basedir}/src/main/asciidoc ${project.basedir}/target/generated-resources @@ -1038,8 +1044,6 @@ ${index-link} - true - ${project.version} ${github-tag} ${version-type}