From 32719783610c58272f7c86d7792cdbdac7936691 Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Mon, 14 Feb 2022 17:04:47 +0000 Subject: [PATCH] INFRA-1697: remove authentication details from gradlew wrapper download and add helper to add them in when ran on CI --- .ci/dev/compatibility/JenkinsfileJDK11Azul | 1 + .ci/dev/compatibility/JenkinsfileJDK11Compile | 1 + .ci/dev/mswin/Jenkinsfile | 1 + .ci/dev/nightly-regression/Jenkinsfile | 1 + .ci/dev/open-j9/Jenkinsfile | 2 ++ .ci/dev/pr-code-checks/Jenkinsfile | 1 + .ci/dev/publish-api-docs/Jenkinsfile | 1 + .ci/dev/publish-branch/Jenkinsfile.nightly | 1 + .ci/dev/publish-branch/Jenkinsfile.preview | 1 + .ci/dev/regression/Jenkinsfile | 3 ++- Jenkinsfile | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- 12 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Azul b/.ci/dev/compatibility/JenkinsfileJDK11Azul index c2216d8a51..11e727b124 100644 --- a/.ci/dev/compatibility/JenkinsfileJDK11Azul +++ b/.ci/dev/compatibility/JenkinsfileJDK11Azul @@ -102,6 +102,7 @@ pipeline { stage('Compile') { steps { dir(sameAgentFolder) { + authenticateGradleWrapper() sh script: [ './gradlew', COMMON_GRADLE_PARAMS, diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Compile b/.ci/dev/compatibility/JenkinsfileJDK11Compile index 0a7ae93060..4fea64e15a 100644 --- a/.ci/dev/compatibility/JenkinsfileJDK11Compile +++ b/.ci/dev/compatibility/JenkinsfileJDK11Compile @@ -25,6 +25,7 @@ pipeline { stages { stage('JDK 11 Compile') { steps { + authenticateGradleWrapper() sh "./gradlew --no-daemon -Pcompilation.allWarningsAsErrors=true -Ptests.failFast=false " + "-Ptests.ignoreFailures=true clean compileAll --stacktrace" } diff --git a/.ci/dev/mswin/Jenkinsfile b/.ci/dev/mswin/Jenkinsfile index 714fadf4fb..e1f70bb4dd 100644 --- a/.ci/dev/mswin/Jenkinsfile +++ b/.ci/dev/mswin/Jenkinsfile @@ -56,6 +56,7 @@ pipeline { stage('Unit Tests') { agent { label 'mswin' } steps { + authenticateGradleWrapper() bat "./gradlew --no-daemon " + "--stacktrace " + "-Pcompilation.warningsAsErrors=false " + diff --git a/.ci/dev/nightly-regression/Jenkinsfile b/.ci/dev/nightly-regression/Jenkinsfile index 98895fdcb8..108050932f 100644 --- a/.ci/dev/nightly-regression/Jenkinsfile +++ b/.ci/dev/nightly-regression/Jenkinsfile @@ -49,6 +49,7 @@ pipeline { stages { stage('Compile') { steps { + authenticateGradleWrapper() sh script: [ './gradlew', COMMON_GRADLE_PARAMS, diff --git a/.ci/dev/open-j9/Jenkinsfile b/.ci/dev/open-j9/Jenkinsfile index 65deab2390..808dac8f08 100644 --- a/.ci/dev/open-j9/Jenkinsfile +++ b/.ci/dev/open-j9/Jenkinsfile @@ -3,6 +3,7 @@ * Jenkins pipeline to build Corda OS release branches and tags. * PLEASE NOTE: we DO want to run a build for each commit!!! */ +@Library('corda-shared-build-pipeline-steps') /** * Sense environment @@ -47,6 +48,7 @@ pipeline { stages { stage('Unit Tests') { steps { + authenticateGradleWrapper() sh "./gradlew clean --continue test --info -Ptests.failFast=true" } } diff --git a/.ci/dev/pr-code-checks/Jenkinsfile b/.ci/dev/pr-code-checks/Jenkinsfile index 5cb1058811..f46ab23810 100644 --- a/.ci/dev/pr-code-checks/Jenkinsfile +++ b/.ci/dev/pr-code-checks/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { stages { stage('Detekt check') { steps { + authenticateGradleWrapper() sh "./gradlew --no-daemon clean detekt" } } diff --git a/.ci/dev/publish-api-docs/Jenkinsfile b/.ci/dev/publish-api-docs/Jenkinsfile index b45aa95e95..2bdda095be 100644 --- a/.ci/dev/publish-api-docs/Jenkinsfile +++ b/.ci/dev/publish-api-docs/Jenkinsfile @@ -33,6 +33,7 @@ pipeline { stage('Publish Archived API Docs to Artifactory') { when { tag pattern: /^docs-release-os-V(\d+\.\d+)(\.\d+){0,1}(-GA){0,1}(-\d{4}-\d\d-\d\d-\d{4}){0,1}$/, comparator: 'REGEXP' } steps { + authenticateGradleWrapper() sh "./gradlew :clean :docs:artifactoryPublish -DpublishApiDocs" } } diff --git a/.ci/dev/publish-branch/Jenkinsfile.nightly b/.ci/dev/publish-branch/Jenkinsfile.nightly index 0f38bf9cca..8da034693c 100644 --- a/.ci/dev/publish-branch/Jenkinsfile.nightly +++ b/.ci/dev/publish-branch/Jenkinsfile.nightly @@ -87,6 +87,7 @@ pipeline { stages { stage('Sonatype Check') { steps { + authenticateGradleWrapper() sh "./gradlew --no-daemon clean jar" script { sh "./gradlew --no-daemon properties | grep -E '^(version|group):' >version-properties" diff --git a/.ci/dev/publish-branch/Jenkinsfile.preview b/.ci/dev/publish-branch/Jenkinsfile.preview index c1cc300089..b795edec93 100644 --- a/.ci/dev/publish-branch/Jenkinsfile.preview +++ b/.ci/dev/publish-branch/Jenkinsfile.preview @@ -29,6 +29,7 @@ pipeline { stages { stage('Publish to Artifactory') { steps { + authenticateGradleWrapper() rtServer ( id: 'R3-Artifactory', url: 'https://software.r3.com/artifactory', diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index e8543c7ab5..58508a6de8 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -3,7 +3,7 @@ * Jenkins pipeline to build Corda OS release branches and tags. * PLEASE NOTE: we DO want to run a build for each commit!!! */ - +@Library('corda-shared-build-pipeline-steps') /** * Sense environment */ @@ -106,6 +106,7 @@ pipeline { stages { stage('Compile') { steps { + authenticateGradleWrapper() sh script: [ './gradlew', COMMON_GRADLE_PARAMS, diff --git a/Jenkinsfile b/Jenkinsfile index 6c684968b3..b46d3647bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,6 +52,7 @@ pipeline { stages { stage('Compile') { steps { + authenticateGradleWrapper() sh script: [ './gradlew', COMMON_GRADLE_PARAMS, @@ -93,6 +94,7 @@ pipeline { } stage('Recompile') { steps { + authenticateGradleWrapper() sh script: [ './gradlew', COMMON_GRADLE_PARAMS, diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 29c1f86072..0ebb3108e2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://gradleproxy:gradleproxy@software.r3.com/artifactory/gradle-proxy/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists