From d19c6dddafda6e944a15ecb27e24c4991aed7683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Thu, 6 Aug 2020 20:17:15 +0100 Subject: [PATCH 1/4] INFRA-541: Remove obsolete `jenkins` prefix from Nexus AppID (#6585) --- .ci/dev/publish-branch/Jenkinsfile.nightly | 2 +- .ci/dev/regression/Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/publish-branch/Jenkinsfile.nightly b/.ci/dev/publish-branch/Jenkinsfile.nightly index 471825bd2d..178f134d9f 100644 --- a/.ci/dev/publish-branch/Jenkinsfile.nightly +++ b/.ci/dev/publish-branch/Jenkinsfile.nightly @@ -53,7 +53,7 @@ pipeline { def version = sh (returnStdout: true, script: "grep ^version: version-properties | sed -e 's/^version: \\([0-9]\\+\\.[0-9]\\+\\).*\$/\\1/'").trim() def groupId = sh (returnStdout: true, script: "grep ^group: version-properties | sed -e 's/^group: //'").trim() def artifactId = 'corda' - nexusAppId = "jenkins-${groupId}-${artifactId}-${version}" + nexusAppId = "${groupId}-${artifactId}-${version}" } nexusPolicyEvaluation ( failBuildOnNetworkError: false, diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index b079bab2e1..32676b0cd7 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -61,7 +61,7 @@ pipeline { def version = sh (returnStdout: true, script: "grep ^version: version-properties | sed -e 's/^version: \\([0-9]\\+\\.[0-9]\\+\\).*\$/\\1/'").trim() def groupId = sh (returnStdout: true, script: "grep ^group: version-properties | sed -e 's/^group: //'").trim() def artifactId = 'corda' - nexusAppId = "jenkins-${groupId}-${artifactId}-${version}" + nexusAppId = "${groupId}-${artifactId}-${version}" } nexusPolicyEvaluation ( failBuildOnNetworkError: false, From e524f417389745634a8a3d9dc26286a6d2d8353e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Thu, 6 Aug 2020 20:20:19 +0100 Subject: [PATCH 2/4] INFRA-542: Allow change of the default Nexus IQ stage parameter (#6586) * adds a parameter to a build * default value of the parameter is the same as original stage parameter --- .ci/dev/publish-branch/Jenkinsfile.nightly | 15 +++++++++++- .ci/dev/regression/Jenkinsfile | 28 ++++++++++++++++++---- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.ci/dev/publish-branch/Jenkinsfile.nightly b/.ci/dev/publish-branch/Jenkinsfile.nightly index 178f134d9f..308d475dcb 100644 --- a/.ci/dev/publish-branch/Jenkinsfile.nightly +++ b/.ci/dev/publish-branch/Jenkinsfile.nightly @@ -20,6 +20,19 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) */ def nexusIqStage = "build" +/** + * make sure calculated default value of NexusIQ stage is first in the list + * thus making it default for the `choice` parameter + */ +def nexusIqStageChoices = [nexusDefaultIqStage].plus( + [ + 'develop', + 'build', + 'stage-release', + 'release', + 'operate' + ].minus([nexusDefaultIqStage])) + pipeline { agent { label 'standard' } @@ -59,7 +72,7 @@ pipeline { failBuildOnNetworkError: false, iqApplication: selectedApplication(nexusAppId), // application *has* to exist before a build starts! iqScanPatterns: [[scanPattern: 'node/capsule/build/libs/corda*.jar']], - iqStage: nexusIqStage + iqStage: params.nexusIqStage ) } } diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 32676b0cd7..fdd7c433be 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -25,15 +25,29 @@ boolean isInternalRelease = (env.TAG_NAME =~ /^internal-release-.*$/) ** * stage-release: for release candidates and for health checks ** * operate: for final release */ -def nexusIqStage = "build" + +def nexusDefaultIqStage = "build" if (isReleaseTag) { switch (env.TAG_NAME) { - case ~/.*-RC\d+(-.*)?/: nexusIqStage = "stage-release"; break; - case ~/.*-HC\d+(-.*)?/: nexusIqStage = "stage-release"; break; - default: nexusIqStage = "release" + case ~/.*-RC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break; + case ~/.*-HC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break; + default: nexusDefaultIqStage = "release" } } +/** + * make sure calculated default value of NexusIQ stage is first in the list + * thus making it default for the `choice` parameter + */ +def nexusIqStageChoices = [nexusDefaultIqStage].plus( + [ + 'develop', + 'build', + 'stage-release', + 'release', + 'operate' + ].minus([nexusDefaultIqStage])) + pipeline { agent { label 'k8s' } options { @@ -42,6 +56,10 @@ pipeline { buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14')) } + parameters { + choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage' + } + environment { DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}" DOCKER_URL = "https://index.docker.io/v1/" @@ -67,7 +85,7 @@ pipeline { failBuildOnNetworkError: false, iqApplication: selectedApplication(nexusAppId), // application *has* to exist before a build starts! iqScanPatterns: [[scanPattern: 'node/capsule/build/libs/corda*.jar']], - iqStage: nexusIqStage + iqStage: params.nexusIqStage ) } } From 56b574c66e2990b10fee6b49f1c45bd7e3742c6f Mon Sep 17 00:00:00 2001 From: Waldemar Zurowski Date: Fri, 7 Aug 2020 06:07:29 +0200 Subject: [PATCH 3/4] Fixed missing elements --- .ci/dev/publish-branch/Jenkinsfile.nightly | 6 +++++- .ci/dev/regression/Jenkinsfile | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.ci/dev/publish-branch/Jenkinsfile.nightly b/.ci/dev/publish-branch/Jenkinsfile.nightly index 308d475dcb..df7f178cac 100644 --- a/.ci/dev/publish-branch/Jenkinsfile.nightly +++ b/.ci/dev/publish-branch/Jenkinsfile.nightly @@ -18,7 +18,7 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) ** calculate the stage for NexusIQ evaluation ** * build for snapshots */ -def nexusIqStage = "build" +def nexusDefaultIqStage = "build" /** * make sure calculated default value of NexusIQ stage is first in the list @@ -44,6 +44,10 @@ pipeline { buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14')) } + parameters { + choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage' + } + triggers { cron '@midnight' } diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index fdd7c433be..0e31ff7305 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -25,7 +25,6 @@ boolean isInternalRelease = (env.TAG_NAME =~ /^internal-release-.*$/) ** * stage-release: for release candidates and for health checks ** * operate: for final release */ - def nexusDefaultIqStage = "build" if (isReleaseTag) { switch (env.TAG_NAME) { From 8e368a2b767be53a4c9a650ea82bb952c2aa2477 Mon Sep 17 00:00:00 2001 From: Waldemar Zurowski Date: Fri, 7 Aug 2020 11:44:14 +0200 Subject: [PATCH 4/4] Synched JDK11 Azul builds configuration with regression build * carries over INFRA-541 and INFRA-542 --- .ci/dev/compatibility/JenkinsfileJDK11Azul | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Azul b/.ci/dev/compatibility/JenkinsfileJDK11Azul index 391a2b5fc6..cad8473b1c 100644 --- a/.ci/dev/compatibility/JenkinsfileJDK11Azul +++ b/.ci/dev/compatibility/JenkinsfileJDK11Azul @@ -25,15 +25,28 @@ boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/) ** * stage-release: for release candidates and for health checks ** * operate: for final release */ -def nexusIqStage = "build" +def nexusDefaultIqStage = "build" if (isReleaseTag) { switch (env.TAG_NAME) { - case ~/.*-RC\d+(-.*)?/: nexusIqStage = "stage-release"; break; - case ~/.*-HC\d+(-.*)?/: nexusIqStage = "stage-release"; break; - default: nexusIqStage = "release" + case ~/.*-RC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break; + case ~/.*-HC\d+(-.*)?/: nexusDefaultIqStage = "stage-release"; break; + default: nexusDefaultIqStage = "release" } } +/** + * make sure calculated default value of NexusIQ stage is first in the list + * thus making it default for the `choice` parameter + */ +def nexusIqStageChoices = [nexusDefaultIqStage].plus( + [ + 'develop', + 'build', + 'stage-release', + 'release', + 'operate' + ].minus([nexusDefaultIqStage])) + pipeline { agent { label 'k8s' } options { @@ -42,6 +55,10 @@ pipeline { buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14')) } + parameters { + choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage' + } + environment { DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}JDK11" EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}" @@ -62,13 +79,13 @@ pipeline { def version = sh (returnStdout: true, script: "grep ^version: version-properties | sed -e 's/^version: \\([0-9]\\+\\.[0-9]\\+\\).*\$/\\1/'").trim() def groupId = sh (returnStdout: true, script: "grep ^group: version-properties | sed -e 's/^group: //'").trim() def artifactId = 'corda' - nexusAppId = "jenkins-${groupId}-${artifactId}-jdk11-${version}" + nexusAppId = "${groupId}-${artifactId}-${version}" } nexusPolicyEvaluation ( failBuildOnNetworkError: false, iqApplication: selectedApplication(nexusAppId), // application *has* to exist before a build starts! iqScanPatterns: [[scanPattern: 'node/capsule/build/libs/corda*.jar']], - iqStage: nexusIqStage + iqStage: params.nexusIqStage ) } }