11import java.nio.charset.StandardCharsets
22
3- ext {
4- // Select which repository to use for publishing the documentation
5- // Example:
6- // ./gradlew uploadDocumentation \
7- // -PdocPublishRepoUri="git@github.com:DavideD/hibernate.org.git" \
8- // -PdocPublishBranch="staging"
9- if ( ! project. hasProperty(' docPublishRepoUri' ) ) {
10- docPublishRepoUri = ' git@github.com:hibernate/hibernate.org.git'
11- }
12- if ( ! project. hasProperty(' docPublishBranch' ) ) {
13- docPublishBranch = ' staging'
14- }
15- }
16-
173description = ' Release module'
184// (Optional) before uploading the documentation, you can check
195// the generated website under release/build/hibernate.org with:
206// ./gradlew gitPublishCopy
217
22- // To publish the documentation:
23- // 1. Add the relevant SSH key to your SSH agent.
24- // 2. Execute this:
25- // ./gradlew uploadDocumentation -PdocPublishBranch=production
8+ // The generated documentation are copied to the
9+ // rootProject.layout.buildDirectory.dir("staging-deploy/documentation") by the updateDocumentationTask
10+ // while the publishing is delegated to the https://github.com/hibernate/hibernate-release-scripts
2611
2712// To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation):
2813// ./gradlew ciRelease -PreleaseVersion=x.y.z.Final -PdevelopmentVersion=x.y.z-SNAPSHOT -PgitRemote=origin -PgitBranch=main
@@ -33,9 +18,6 @@ final Directory documentationDir = project(":documentation").layout.buildDirecto
3318// Relative path on the static website where the documentation is located
3419final String docWebsiteRelativePath = " reactive/documentation/${ projectVersion.family} "
3520
36- // The location of the docs when the website has been cloned
37- final Directory docWebsiteReactiveFolder = project. layout. buildDirectory. dir( " docs-website/${ docWebsiteRelativePath} " ). get()
38-
3921def releaseChecksTask = tasks. register( " releaseChecks" ) {
4022 description ' Checks and preparation for release'
4123 group ' Release'
@@ -98,30 +80,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
9880}
9981assemble. dependsOn assembleDocumentationTask
10082
101- /**
102- * Clone the website
103- */
104- def removeDocsWebsiteTask = tasks. register( ' removeDocsWebsite' , Delete ) {
105- delete project. layout. buildDirectory. dir( " docs-website" )
106- }
107-
108- def cloneDocsWebsiteTask = tasks. register( ' cloneDocsWebsite' , Exec ) {
109- dependsOn removeDocsWebsiteTask
110- // Assure that the buildDir exists. Otherwise this task will fail.
111- dependsOn compileJava
112- workingDir project. layout. buildDirectory
113- commandLine ' git' , ' clone' , docPublishRepoUri, ' -b' , docPublishBranch, ' --sparse' , ' --depth' , ' 1' , ' docs-website'
114- }
115-
116- def sparseCheckoutDocumentationTask = tasks. register( ' sparseCheckoutDocumentation' , Exec ) {
117- dependsOn cloneDocsWebsiteTask
118- workingDir project. layout. buildDirectory. dir( " docs-website" )
119- commandLine ' git' , ' sparse-checkout' , ' set' , docWebsiteRelativePath
120- }
121-
122- /**
123- * Update the docs on the cloned website
124- */
12583def changeToReleaseVersionTask = tasks. register( ' changeToReleaseVersion' ) {
12684 description ' Updates `gradle/version.properties` file to the specified release-version'
12785 group ' Release'
@@ -136,57 +94,25 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
13694
13795def updateDocumentationTask = tasks. register( ' updateDocumentation' ) {
13896 description " Update the documentation on the cloned static website"
139- dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
97+ dependsOn assembleDocumentationTask
14098 mustRunAfter changeToReleaseVersion
14199
142100 // copy documentation outputs into target/documentation:
143101 // * this is used in building the dist bundles
144102 // * it is also used as a base to build a staged directory for documentation upload
145103
146104 doLast {
147- // delete the folders in case some files have been removed
148- delete docWebsiteReactiveFolder. dir(" javadocs" ), docWebsiteReactiveFolder. dir(" reference" )
149-
150105 // Aggregated JavaDoc
151- copy {
152- from documentationDir. dir(" javadocs" )
153- into docWebsiteReactiveFolder . dir(" javadocs" )
154- }
106+ copy {
107+ from documentationDir. dir(" javadocs" )
108+ into rootProject . layout . buildDirectory . dir(" staging-deploy/documentation/ javadocs" )
109+ }
155110
156111 // Reference Documentation
157- copy {
158- from documentationDir. dir(" asciidoc/reference/html_single" )
159- into docWebsiteReactiveFolder. dir(" reference/html_single" )
160- }
161- }
162- }
163-
164- def stageDocChangesTask = tasks. register( ' stageDocChanges' , Exec ) {
165- dependsOn updateDocumentationTask
166- workingDir project. layout. buildDirectory. dir( " docs-website" )
167- commandLine ' git' , ' add' , ' -A' , ' .'
168- }
169-
170- def commitDocChangesTask = tasks. register( ' commitDocChanges' , Exec ) {
171- dependsOn stageDocChangesTask
172- workingDir project. layout. buildDirectory. dir( " docs-website" )
173- commandLine ' git' , ' commit' , ' -m' , " [HR] Hibernate Reactive documentation for ${ projectVersion} "
174- }
175-
176- def pushDocChangesTask = tasks. register( ' pushDocChanges' , Exec ) {
177- description " Push documentation changes on the remote repository"
178- dependsOn commitDocChangesTask
179- workingDir project. layout. buildDirectory. dir( " docs-website" )
180- commandLine ' git' , ' push' , ' --atomic' , ' origin' , docPublishBranch
181- }
182-
183- def uploadDocumentationTask = tasks. register( ' uploadDocumentation' ) {
184- description " Upload documentation on the website"
185- group " Release"
186- dependsOn pushDocChangesTask
187-
188- doLast {
189- logger. lifecycle " Documentation published on '${ docPublishRepoUri} ' branch '${ docPublishBranch} '"
112+ copy {
113+ from documentationDir. dir(" asciidoc/reference/html_single" )
114+ into rootProject. layout. buildDirectory. dir(" staging-deploy/documentation/reference/html_single" )
115+ }
190116 }
191117}
192118
@@ -235,7 +161,7 @@ void updateVersionFile(var version) {
235161}
236162
237163def publishReleaseArtifactsTask = tasks. register( ' publishReleaseArtifacts' ) {
238- dependsOn uploadDocumentationTask
164+ dependsOn updateDocumentationTask
239165
240166 mustRunAfter gitPreparationForReleaseTask
241167}
0 commit comments