mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
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 543e095cf70396256ebbf2dd9e9d07f80304bebd)
This commit is contained in:
parent
222b1a2b26
commit
6fcb0d50fb
11
ci/release/Jenkinsfile
vendored
11
ci/release/Jenkinsfile
vendored
@ -135,7 +135,10 @@ pipeline {
|
|||||||
// update changelog from JIRA
|
// update changelog from JIRA
|
||||||
// tags the version
|
// tags the version
|
||||||
// changes the version to the provided development version
|
// changes the version to the provided development version
|
||||||
withEnv(["BRANCH=${env.GIT_BRANCH}"]) {
|
withEnv([
|
||||||
|
"BRANCH=${env.GIT_BRANCH}",
|
||||||
|
"DISABLE_REMOTE_GRADLE_CACHE=true"
|
||||||
|
]) {
|
||||||
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
|
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,7 +164,11 @@ pipeline {
|
|||||||
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
|
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
|
||||||
// performs documentation upload and Sonatype release
|
// performs documentation upload and Sonatype release
|
||||||
// push to github
|
// push to github
|
||||||
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
|
withEnv([
|
||||||
|
"DISABLE_REMOTE_GRADLE_CACHE=true"
|
||||||
|
]) {
|
||||||
|
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,15 +37,20 @@ pipeline {
|
|||||||
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'),
|
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'),
|
||||||
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING')
|
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING')
|
||||||
]) {
|
]) {
|
||||||
sh '''./gradlew clean publish \
|
withEnv([
|
||||||
-PhibernatePublishUsername=$hibernatePublishUsername \
|
"DISABLE_REMOTE_GRADLE_CACHE=true"
|
||||||
-PhibernatePublishPassword=$hibernatePublishPassword \
|
]) {
|
||||||
-Pgradle.publish.key=$hibernatePluginPortalUsername \
|
sh '''./gradlew clean publish \
|
||||||
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
|
-PhibernatePublishUsername=$hibernatePublishUsername \
|
||||||
--no-scan \
|
-PhibernatePublishPassword=$hibernatePublishPassword \
|
||||||
-DsigningPassword=$SIGNING_PASS \
|
-Pgradle.publish.key=$hibernatePluginPortalUsername \
|
||||||
-DsigningKeyFile=$SIGNING_KEYRING \
|
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
|
||||||
'''
|
--no-scan \
|
||||||
|
--no-build-cache \
|
||||||
|
-DsigningPassword=$SIGNING_PASS \
|
||||||
|
-DsigningKeyFile=$SIGNING_KEYRING \
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
ext {
|
ext {
|
||||||
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
|
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
|
||||||
populateRemoteBuildCache = getSetting( "POPULATE_REMOTE" ).isPresent()
|
populateRemoteBuildCache = isEnabled( "POPULATE_REMOTE" )
|
||||||
|
useRemoteCache = !isEnabled( "DISABLE_REMOTE_GRADLE_CACHE" )
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isJenkins() {
|
private static boolean isJenkins() {
|
||||||
@ -36,6 +37,14 @@ static java.util.Optional<String> getSetting(String name) {
|
|||||||
return java.util.Optional.ofNullable(sysProp);
|
return java.util.Optional.ofNullable(sysProp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean isEnabled(String setting) {
|
||||||
|
if ( System.getenv().hasProperty( setting ) ) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return System.hasProperty( setting )
|
||||||
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
server = 'https://ge.hibernate.org'
|
server = 'https://ge.hibernate.org'
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ buildCache {
|
|||||||
enabled = !settings.ext.isCiEnvironment
|
enabled = !settings.ext.isCiEnvironment
|
||||||
}
|
}
|
||||||
remote(HttpBuildCache) {
|
remote(HttpBuildCache) {
|
||||||
enabled = true
|
enabled = settings.ext.useRemoteCache
|
||||||
// Check access key presence to avoid build cache errors on PR builds when access key is not present
|
// Check access key presence to avoid build cache errors on PR builds when access key is not present
|
||||||
def accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY")
|
def accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY")
|
||||||
push = settings.ext.populateRemoteBuildCache && accessKey
|
push = settings.ext.populateRemoteBuildCache && accessKey
|
||||||
|
Loading…
x
Reference in New Issue
Block a user