Skip to content

Commit 6148cda

Browse files
committed
[#2570] Hibernate Reactive builds will no longer publish docs to https://hibernate.org
1 parent 24bd78d commit 6148cda

File tree

1 file changed

+13
-89
lines changed

1 file changed

+13
-89
lines changed

release/build.gradle

Lines changed: 13 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,22 @@ import java.nio.charset.StandardCharsets
33
plugins {
44
id "hr-java-library"
55
}
6-
ext {
7-
// Select which repository to use for publishing the documentation
8-
// Example:
9-
// ./gradlew uploadDocumentation \
10-
// -PdocPublishRepoUri="[email protected]:DavideD/hibernate.org.git" \
11-
// -PdocPublishBranch="staging"
12-
if ( !project.hasProperty('docPublishRepoUri') ) {
13-
docPublishRepoUri = '[email protected]:hibernate/hibernate.org.git'
14-
}
15-
if ( !project.hasProperty('docPublishBranch') ) {
16-
docPublishBranch = 'staging'
17-
}
18-
}
196

207
description = 'Release module'
218
// (Optional) before uploading the documentation, you can check
229
// the generated website under release/build/hibernate.org with:
2310
// ./gradlew gitPublishCopy
2411

25-
// To publish the documentation:
26-
// 1. Add the relevant SSH key to your SSH agent.
27-
// 2. Execute this:
28-
// ./gradlew uploadDocumentation -PdocPublishBranch=production
12+
// The generated documentation are copied to the
13+
// rootProject.layout.buildDirectory.dir("staging-deploy/documentation") by the updateDocumentationTask
14+
// while the publishing is delegated to the https://github.com/hibernate/hibernate-release-scripts
2915

3016
// To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation):
3117
// ./gradlew ciRelease -PreleaseVersion=x.y.z.Final -PdevelopmentVersion=x.y.z-SNAPSHOT -PgitRemote=origin -PgitBranch=main
3218

3319
// The folder containing the rendered documentation
3420
final Directory documentationDir = project(":documentation").layout.buildDirectory.get()
3521

36-
// Relative path on the static website where the documentation is located
37-
final String docWebsiteRelativePath = "reactive/documentation/${projectVersion.family}"
38-
39-
// The location of the docs when the website has been cloned
40-
final Directory docWebsiteReactiveFolder = project.layout.buildDirectory.dir( "docs-website/${docWebsiteRelativePath}" ).get()
41-
4222
def releaseChecksTask = tasks.register( "releaseChecks" ) {
4323
description 'Checks and preparation for release'
4424
group 'Release'
@@ -101,30 +81,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) {
10181
}
10282
assemble.dependsOn assembleDocumentationTask
10383

104-
/**
105-
* Clone the website
106-
*/
107-
def removeDocsWebsiteTask = tasks.register( 'removeDocsWebsite', Delete ) {
108-
delete project.layout.buildDirectory.dir( "docs-website" )
109-
}
110-
111-
def cloneDocsWebsiteTask = tasks.register( 'cloneDocsWebsite', Exec ) {
112-
dependsOn removeDocsWebsiteTask
113-
// Assure that the buildDir exists. Otherwise this task will fail.
114-
dependsOn compileJava
115-
workingDir project.layout.buildDirectory
116-
commandLine 'git', 'clone', docPublishRepoUri, '-b', docPublishBranch, '--sparse', '--depth', '1', 'docs-website'
117-
}
118-
119-
def sparseCheckoutDocumentationTask = tasks.register( 'sparseCheckoutDocumentation', Exec ) {
120-
dependsOn cloneDocsWebsiteTask
121-
workingDir project.layout.buildDirectory.dir( "docs-website" )
122-
commandLine 'git', 'sparse-checkout', 'set', docWebsiteRelativePath
123-
}
124-
125-
/**
126-
* Update the docs on the cloned website
127-
*/
12884
def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
12985
description 'Updates `gradle/version.properties` file to the specified release-version'
13086
group 'Release'
@@ -139,57 +95,25 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) {
13995

14096
def updateDocumentationTask = tasks.register( 'updateDocumentation' ) {
14197
description "Update the documentation on the cloned static website"
142-
dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask
98+
dependsOn assembleDocumentationTask
14399
mustRunAfter changeToReleaseVersion
144100

145101
// copy documentation outputs into target/documentation:
146102
// * this is used in building the dist bundles
147103
// * it is also used as a base to build a staged directory for documentation upload
148104

149105
doLast {
150-
// delete the folders in case some files have been removed
151-
delete docWebsiteReactiveFolder.dir("javadocs"), docWebsiteReactiveFolder.dir("reference")
152-
153106
// Aggregated JavaDoc
154-
copy {
155-
from documentationDir.dir("javadocs")
156-
into docWebsiteReactiveFolder.dir("javadocs")
157-
}
107+
copy {
108+
from documentationDir.dir("javadocs")
109+
into rootProject.layout.buildDirectory.dir("staging-deploy/documentation/javadocs")
110+
}
158111

159112
// Reference Documentation
160-
copy {
161-
from documentationDir.dir("asciidoc/reference/html_single")
162-
into docWebsiteReactiveFolder.dir("reference/html_single")
163-
}
164-
}
165-
}
166-
167-
def stageDocChangesTask = tasks.register( 'stageDocChanges', Exec ) {
168-
dependsOn updateDocumentationTask
169-
workingDir project.layout.buildDirectory.dir( "docs-website" )
170-
commandLine 'git', 'add', '-A', '.'
171-
}
172-
173-
def commitDocChangesTask = tasks.register( 'commitDocChanges', Exec ) {
174-
dependsOn stageDocChangesTask
175-
workingDir project.layout.buildDirectory.dir( "docs-website" )
176-
commandLine 'git', 'commit', '-m', "[HR] Hibernate Reactive documentation for ${projectVersion}"
177-
}
178-
179-
def pushDocChangesTask = tasks.register( 'pushDocChanges', Exec ) {
180-
description "Push documentation changes on the remote repository"
181-
dependsOn commitDocChangesTask
182-
workingDir project.layout.buildDirectory.dir( "docs-website" )
183-
commandLine 'git', 'push', '--atomic', 'origin', docPublishBranch
184-
}
185-
186-
def uploadDocumentationTask = tasks.register( 'uploadDocumentation' ) {
187-
description "Upload documentation on the website"
188-
group "Release"
189-
dependsOn pushDocChangesTask
190-
191-
doLast {
192-
logger.lifecycle "Documentation published on '${docPublishRepoUri}' branch '${docPublishBranch}'"
113+
copy {
114+
from documentationDir.dir("asciidoc/reference/html_single")
115+
into rootProject.layout.buildDirectory.dir("staging-deploy/documentation/reference/html_single")
116+
}
193117
}
194118
}
195119

@@ -238,7 +162,7 @@ void updateVersionFile(var version) {
238162
}
239163

240164
def publishReleaseArtifactsTask = tasks.register( 'publishReleaseArtifacts' ) {
241-
dependsOn uploadDocumentationTask
165+
dependsOn updateDocumentationTask
242166

243167
mustRunAfter gitPreparationForReleaseTask
244168
}

0 commit comments

Comments
 (0)