From ac0e35c8540258a51373f14221788290afe19e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 19 Jun 2020 22:03:09 +0100 Subject: [PATCH 1/4] Trying to ignore push events for Windows Server builds (#6383) --- .ci/dev/mswin/Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/dev/mswin/Jenkinsfile b/.ci/dev/mswin/Jenkinsfile index 8a7d19c5a3..f09522578b 100644 --- a/.ci/dev/mswin/Jenkinsfile +++ b/.ci/dev/mswin/Jenkinsfile @@ -28,6 +28,9 @@ pipeline { ansiColor('xterm') timestamps() timeout(time: 3, unit: 'HOURS') +// overrideIndexTriggers true // works as expected for PRs +// overrideIndexTriggers false // works as expected for non PRs + overrideIndexTriggers (!isReleaseBranch) } parameters { From a7644dab8bada9dc5d7a4112a8934bd40380ec18 Mon Sep 17 00:00:00 2001 From: Waldemar Zurowski Date: Fri, 19 Jun 2020 22:09:02 +0100 Subject: [PATCH 2/4] Cosmetic change for Windows Server builds --- .ci/dev/mswin/Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/dev/mswin/Jenkinsfile b/.ci/dev/mswin/Jenkinsfile index f09522578b..ffbfbcb5d6 100644 --- a/.ci/dev/mswin/Jenkinsfile +++ b/.ci/dev/mswin/Jenkinsfile @@ -28,8 +28,12 @@ pipeline { ansiColor('xterm') timestamps() timeout(time: 3, unit: 'HOURS') -// overrideIndexTriggers true // works as expected for PRs -// overrideIndexTriggers false // works as expected for non PRs + + /* + * a bit awkward to read + * is parameter is true -> push events are *not* ignored + * if parameter is false -> push events *are* ignored + */ overrideIndexTriggers (!isReleaseBranch) } From e021022d0d3e56cb76e1f85f2e4e5f8652011dbe Mon Sep 17 00:00:00 2001 From: Razvan Codreanu <52859362+Schife@users.noreply.github.com> Date: Sat, 20 Jun 2020 11:08:52 +0100 Subject: [PATCH 3/4] INFRA-357 Publish build tag (#6375) --- .ci/dev/compatibility/JenkinsfileJDK11Azul | 121 --------------------- .ci/dev/regression/Jenkinsfile | 35 +++++- testing/DockerfileJDK11Azul | 3 - 3 files changed, 33 insertions(+), 126 deletions(-) delete mode 100644 .ci/dev/compatibility/JenkinsfileJDK11Azul delete mode 100644 testing/DockerfileJDK11Azul diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Azul b/.ci/dev/compatibility/JenkinsfileJDK11Azul deleted file mode 100644 index a61b5dc228..0000000000 --- a/.ci/dev/compatibility/JenkinsfileJDK11Azul +++ /dev/null @@ -1,121 +0,0 @@ -@Library('corda-shared-build-pipeline-steps') -import static com.r3.build.BuildControl.killAllExistingBuildsForJob - -killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) - -/** - * Sense environment - */ -boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/) - -pipeline { - agent { - dockerfile { - label 'k8s' - additionalBuildArgs "--build-arg USER=stresstester" - filename '.ci/dev/compatibility/DockerfileJDK11' - } - } - options { - timestamps() - buildDiscarder(logRotator(daysToKeepStr: '7', artifactDaysToKeepStr: '7')) - timeout(time: 3, unit: 'HOURS') - } - - environment { - DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}JDK11" - EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}" - BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}" - ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') - ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish JDK 11 Release to Artifactory".replaceAll("/", "::") - } - - stages { - stage('Generate Build Image') { - steps { - withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) { - sh "./gradlew " + - "-Dkubenetize=true " + - "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + - "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + - "-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\" " + - "-Ddocker.buildbase.tag=11latest " + - "-Ddocker.dockerfile=DockerfileJDK11Azul" + - " clean pushBuildImage preAllocateForParallelRegressionTest preAllocateForAllParallelSlowIntegrationTest --stacktrace" - } - sh "kubectl auth can-i get pods" - } - } - - stage('Testing phase') { - parallel { - stage('Regression Test') { - steps { - sh "./gradlew " + - "-DbuildId=\"\${BUILD_ID}\" " + - "-Dkubenetize=true " + - "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + - "-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " + - "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + - "-Dgit.branch=\"\${GIT_BRANCH}\" " + - "-Dgit.target.branch=\"\${GIT_BRANCH}\" " + - " parallelRegressionTest --stacktrace" - } - } - stage('Slow Integration Test') { - steps { - sh "./gradlew " + - "-DbuildId=\"\${BUILD_ID}\" " + - "-Dkubenetize=true " + - "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + - "-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " + - "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + - "-Dgit.branch=\"\${GIT_BRANCH}\" " + - "-Dgit.target.branch=\"\${GIT_BRANCH}\" " + - " allParallelSlowIntegrationTest --stacktrace" - } - } - } - } - - stage('Publish to Artifactory') { - when { - expression { isReleaseTag } - } - steps { - rtServer( - id: 'R3-Artifactory', - url: 'https://software.r3.com/artifactory', - credentialsId: 'artifactory-credentials' - ) - rtGradleDeployer( - id: 'deployer', - serverId: 'R3-Artifactory', - repo: 'r3-corda-releases' - ) - rtGradleRun( - usesPlugin: true, - useWrapper: true, - switches: '-s --info', - tasks: 'artifactoryPublish', - deployerId: 'deployer', - buildName: env.ARTIFACTORY_BUILD_NAME - ) - rtPublishBuildInfo( - serverId: 'R3-Artifactory', - buildName: env.ARTIFACTORY_BUILD_NAME - ) - } - } - } - - post { - always { - archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false - junit '**/build/test-results-xml/**/*.xml' - } - cleanup { - deleteDir() /* clean up our workspace */ - } - } -} diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index be45291160..62f9292f77 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -17,7 +17,7 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) /** * Sense environment */ -boolean isTag = (env.TAG_NAME =~ /^release-V(\d+\.\d+)?(\.\d+)?(-.+)?$/) +boolean isReleaseTag = (env.TAG_NAME =~ /^release-.*(? Date: Sat, 20 Jun 2020 11:25:20 +0100 Subject: [PATCH 4/4] INFRA-357 Re adding JDK 11 regression build file that was removed in the 4.4 to 4.5 merge --- .ci/dev/compatibility/JenkinsfileJDK11Azul | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .ci/dev/compatibility/JenkinsfileJDK11Azul diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Azul b/.ci/dev/compatibility/JenkinsfileJDK11Azul new file mode 100644 index 0000000000..fd6767e1e0 --- /dev/null +++ b/.ci/dev/compatibility/JenkinsfileJDK11Azul @@ -0,0 +1,124 @@ +@Library('corda-shared-build-pipeline-steps') +import static com.r3.build.BuildControl.killAllExistingBuildsForJob + +killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) + +/** + * Sense environment + */ +boolean isReleaseTag = (env.TAG_NAME =~ /^release.*JDK11$/) + +pipeline { + agent { + label 'k8s' + } + options { + timestamps() + buildDiscarder(logRotator(daysToKeepStr: '7', artifactDaysToKeepStr: '7')) + timeout(time: 3, unit: 'HOURS') + } + + environment { + DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}JDK11" + EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}" + BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}" + ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') + ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish JDK 11 Release to Artifactory".replaceAll("/", "::") + } + + stages { + stage('Generate Build Image') { + steps { + withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) { + sh "./gradlew " + + "-Dkubenetize=true " + + "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + + "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + + "-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\" " + + "-Ddocker.buildbase.tag=11latest " + + "-Ddocker.dockerfile=DockerfileJDK11Azul" + + " clean pushBuildImage preAllocateForParallelRegressionTest preAllocateForAllParallelSlowIntegrationTest --stacktrace" + } + sh "kubectl auth can-i get pods" + } + } + + stage('Testing phase') { + parallel { + stage('Regression Test') { + steps { + sh "./gradlew " + + "-DbuildId=\"\${BUILD_ID}\" " + + "-Dkubenetize=true " + + "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + + "-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " + + "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + + "-Dgit.branch=\"\${GIT_BRANCH}\" " + + "-Dgit.target.branch=\"\${GIT_BRANCH}\" " + + " parallelRegressionTest --stacktrace" + } + } + stage('Slow Integration Test') { + steps { + sh "./gradlew " + + "-DbuildId=\"\${BUILD_ID}\" " + + "-Dkubenetize=true " + + "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + + "-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " + + "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + + "-Dgit.branch=\"\${GIT_BRANCH}\" " + + "-Dgit.target.branch=\"\${GIT_BRANCH}\" " + + " allParallelSlowIntegrationTest --stacktrace" + } + } + } + } + + stage('Publish to Artifactory') { + agent { + dockerfile { + reuseNode true + additionalBuildArgs "--build-arg USER=stresstester" + filename '.ci/dev/compatibility/DockerfileJDK11' + } + } + when { + expression { isReleaseTag } + } + steps { + rtServer( + id: 'R3-Artifactory', + url: 'https://software.r3.com/artifactory', + credentialsId: 'artifactory-credentials' + ) + rtGradleDeployer( + id: 'deployer', + serverId: 'R3-Artifactory', + repo: 'r3-corda-releases' + ) + rtGradleRun( + usesPlugin: true, + useWrapper: true, + switches: '-s --info', + tasks: 'artifactoryPublish', + deployerId: 'deployer', + buildName: env.ARTIFACTORY_BUILD_NAME + ) + rtPublishBuildInfo( + serverId: 'R3-Artifactory', + buildName: env.ARTIFACTORY_BUILD_NAME + ) + } + } + } + + post { + always { + archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false + junit '**/build/test-results-xml/**/*.xml' + } + cleanup { + deleteDir() /* clean up our workspace */ + } + } +}