Skip to content

Commit 08ac5d3

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 a8c113d commit 08ac5d3

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

ci/release/Jenkinsfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ pipeline {
135135
// update changelog from JIRA
136136
// tags the version
137137
// changes the version to the provided development version
138-
withEnv(["BRANCH=${env.GIT_BRANCH}"]) {
138+
withEnv([
139+
"BRANCH=${env.GIT_BRANCH}",
140+
"DISABLE_REMOTE_GRADLE_CACHE=true"
141+
]) {
139142
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
140143
}
141144
}
@@ -161,7 +164,11 @@ pipeline {
161164
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
162165
// performs documentation upload and Sonatype release
163166
// push to github
164-
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
167+
withEnv([
168+
"DISABLE_REMOTE_GRADLE_CACHE=true"
169+
]) {
170+
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
171+
}
165172
}
166173
}
167174
}

gradle/gradle-enterprise.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
ext {
1313
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
14-
populateRemoteBuildCache = getSetting( "POPULATE_REMOTE" ).isPresent()
14+
populateRemoteBuildCache = isEnabled( "POPULATE_REMOTE" )
15+
useRemoteCache = !isEnabled( "DISABLE_REMOTE_GRADLE_CACHE" )
1516
}
1617

1718
private static boolean isJenkins() {
@@ -36,6 +37,14 @@ static java.util.Optional<String> getSetting(String name) {
3637
return java.util.Optional.ofNullable(sysProp);
3738
}
3839

40+
static boolean isEnabled(String setting) {
41+
if ( System.getenv().hasProperty( setting ) ) {
42+
return true
43+
}
44+
45+
return System.hasProperty( setting )
46+
}
47+
3948
gradleEnterprise {
4049
server = 'https://ge.hibernate.org'
4150

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ buildCache {
279279
enabled = !settings.ext.isCiEnvironment
280280
}
281281
remote(HttpBuildCache) {
282-
enabled = true
282+
enabled = settings.ext.useRemoteCache
283283
push = settings.ext.populateRemoteBuildCache
284284
url = 'https://ge.hibernate.org/cache/'
285285
}

0 commit comments

Comments
 (0)