Skip to content

Commit cf6ac4a

Browse files
committed
Don't use the build cache during releases
So that we're extra sure we're not relying on cache left by a previous Gradle execution. (cherry picked from commit 543e095)
1 parent 12b0392 commit cf6ac4a

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

ci/release/Jenkinsfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ pipeline {
176176
// changes the version to the provided development version
177177
withEnv([
178178
"BRANCH=${env.GIT_BRANCH}",
179+
"DISABLE_REMOTE_GRADLE_CACHE=true",
179180
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
180181
"GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
181182
]) {
@@ -206,7 +207,11 @@ pipeline {
206207
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
207208
// performs documentation upload and Sonatype release
208209
// push to github
209-
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
210+
withEnv([
211+
"DISABLE_REMOTE_GRADLE_CACHE=true"
212+
]) {
213+
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
214+
}
210215
}
211216
}
212217
}

ci/snapshot-publish.Jenkinsfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,20 @@ pipeline {
3737
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'),
3838
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING')
3939
]) {
40-
sh '''./gradlew clean publish \
41-
-PhibernatePublishUsername=$hibernatePublishUsername \
42-
-PhibernatePublishPassword=$hibernatePublishPassword \
43-
-Pgradle.publish.key=$hibernatePluginPortalUsername \
44-
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
45-
--no-scan \
46-
-DsigningPassword=$SIGNING_PASS \
47-
-DsigningKeyFile=$SIGNING_KEYRING \
48-
'''
40+
withEnv([
41+
"DISABLE_REMOTE_GRADLE_CACHE=true"
42+
]) {
43+
sh '''./gradlew clean publish \
44+
-PhibernatePublishUsername=$hibernatePublishUsername \
45+
-PhibernatePublishPassword=$hibernatePublishPassword \
46+
-Pgradle.publish.key=$hibernatePluginPortalUsername \
47+
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
48+
--no-scan \
49+
--no-build-cache \
50+
-DsigningPassword=$SIGNING_PASS \
51+
-DsigningKeyFile=$SIGNING_KEYRING \
52+
'''
53+
}
4954
}
5055
}
5156
}

gradle/gradle-develocity.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
ext {
1313
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
1414
populateRemoteBuildCache = isEnabled( "POPULATE_REMOTE_GRADLE_CACHE" )
15+
useRemoteCache = !isEnabled( "DISABLE_REMOTE_GRADLE_CACHE" )
1516
}
1617

1718
private static boolean isJenkins() {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ buildCache {
300300
enabled = !settings.ext.isCiEnvironment
301301
}
302302
remote(develocity.buildCache) {
303-
enabled = true
303+
enabled = settings.ext.useRemoteCache
304304
// Check access key presence to avoid build cache errors on PR builds when access key is not present
305305
def accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")
306306
push = settings.ext.populateRemoteBuildCache && accessKey

0 commit comments

Comments
 (0)