From 56153608af4d8d0a7a6bf50d5b8061cdd1678d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 12 Jun 2024 11:11:20 +0200 Subject: [PATCH] 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. --- ci/release/Jenkinsfile | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index 9324700642..ad0d45fb32 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -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']]) } // Determine version information for release process - env.CURRENT_VERSION = sh( + def currentVersion = sh( script: ".release/scripts/determine-current-version.sh ${env.PROJECT}", returnStdout: true ).trim() + echo "Workspace version: ${currentVersion}" if ( params.RELEASE_VERSION == null || params.RELEASE_VERSION.isEmpty() ) { env.RELEASE_VERSION = sh( - script: ".release/scripts/determine-release-version.sh ${env.CURRENT_VERSION}", + script: ".release/scripts/determine-release-version.sh ${currentVersion}", returnStdout: true ).trim() } else { env.RELEASE_VERSION = params.RELEASE_VERSION } + echo "Release version: ${env.RELEASE_VERSION}" + if ( params.DEVELOPMENT_VERSION == null || params.DEVELOPMENT_VERSION.isEmpty() ) { env.DEVELOPMENT_VERSION = sh( script: ".release/scripts/determine-development-version.sh ${env.RELEASE_VERSION}", @@ -93,26 +96,17 @@ pipeline { else { 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}", returnStdout: true ).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" : "" - 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 - 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) } } }