Release Jenkinsfile: clarify what's used as an environment variable and what isn't

Some of these were actually just local variables, and some weren't even
used anywhere.
This commit is contained in:
Yoann Rodière 2024-06-12 11:11:20 +02:00 committed by Christian Beikov
parent 26f6cdab03
commit c4aa0bd676
1 changed files with 10 additions and 16 deletions

View File

@ -70,20 +70,23 @@ pipeline {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']]) checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
} }
// Determine version information for release process // Determine version information for release process
env.CURRENT_VERSION = sh( def currentVersion = sh(
script: ".release/scripts/determine-current-version.sh ${env.PROJECT}", script: ".release/scripts/determine-current-version.sh ${env.PROJECT}",
returnStdout: true returnStdout: true
).trim() ).trim()
echo "Workspace version: ${currentVersion}"
if ( params.RELEASE_VERSION == null || params.RELEASE_VERSION.isEmpty() ) { if ( params.RELEASE_VERSION == null || params.RELEASE_VERSION.isEmpty() ) {
env.RELEASE_VERSION = sh( env.RELEASE_VERSION = sh(
script: ".release/scripts/determine-release-version.sh ${env.CURRENT_VERSION}", script: ".release/scripts/determine-release-version.sh ${currentVersion}",
returnStdout: true returnStdout: true
).trim() ).trim()
} }
else { else {
env.RELEASE_VERSION = params.RELEASE_VERSION env.RELEASE_VERSION = params.RELEASE_VERSION
} }
echo "Release version: ${env.RELEASE_VERSION}"
if ( params.DEVELOPMENT_VERSION == null || params.DEVELOPMENT_VERSION.isEmpty() ) { if ( params.DEVELOPMENT_VERSION == null || params.DEVELOPMENT_VERSION.isEmpty() ) {
env.DEVELOPMENT_VERSION = sh( env.DEVELOPMENT_VERSION = sh(
script: ".release/scripts/determine-development-version.sh ${env.RELEASE_VERSION}", script: ".release/scripts/determine-development-version.sh ${env.RELEASE_VERSION}",
@ -93,26 +96,17 @@ pipeline {
else { else {
env.DEVELOPMENT_VERSION = params.DEVELOPMENT_VERSION env.DEVELOPMENT_VERSION = params.DEVELOPMENT_VERSION
} }
env.VERSION_BASIS = sh( echo "Development version: ${env.DEVELOPMENT_VERSION}"
def versionBasis = sh(
script: ".release/scripts/determine-version-basis.sh ${env.RELEASE_VERSION}", script: ".release/scripts/determine-version-basis.sh ${env.RELEASE_VERSION}",
returnStdout: true returnStdout: true
).trim() ).trim()
env.VERSION_FAMILY = sh(
script: ".release/scripts/determine-version-family.sh ${env.RELEASE_VERSION}",
returnStdout: true
).trim()
env.NEXT_VERSION_BASIS = sh(
script: ".release/scripts/determine-version-basis.sh ${env.DEVELOPMENT_VERSION}",
returnStdout: true
).trim()
env.SCRIPT_OPTIONS = params.RELEASE_DRY_RUN ? "-d" : "" env.SCRIPT_OPTIONS = params.RELEASE_DRY_RUN ? "-d" : ""
echo "Workspace version: ${env.CURRENT_VERSION}"
echo "Release version: ${env.RELEASE_VERSION}"
echo "Development version: ${env.DEVELOPMENT_VERSION}"
echo "Version family: ${env.VERSION_FAMILY}"
// Determine version id to check if Jira version exists // Determine version id to check if Jira version exists
sh(script: ".release/scripts/determine-jira-version-id.sh ${env.JIRA_KEY} ${env.VERSION_BASIS}", returnStdout: true) sh(script: ".release/scripts/determine-jira-version-id.sh ${env.JIRA_KEY} ${versionBasis}", returnStdout: true)
} }
} }
} }