From a57e478e47fe73646aa0f2aa080b59ad53929cc3 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Tue, 16 Jan 2024 18:12:36 +0100 Subject: [PATCH] Set credentials to write build cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Pfeuffer --- Jenkinsfile | 8 ++++++-- settings.gradle | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 545c2527ac..203597e9f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,8 +55,12 @@ pipeline { stage('Build') { steps { - // build without tests - gradle "-xtest build" + withCredentials([ + usernamePassword(credentialsId: 'scmm-gradle-build-cache', usernameVariable: 'GRADLE_BUILD_CACHE_USER', passwordVariable: 'GRADLE_BUILD_CACHE_PASSWORD') + ]) { + // build without tests + gradle "-xtest build" + } } } diff --git a/settings.gradle b/settings.gradle index f67acde01f..5015455ba5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -90,5 +90,9 @@ buildCache { useExpectContinue = true url = 'https://build-cache.scm-manager.org/cache/' push = true + credentials { + username = System.getenv('GRADLE_BUILD_CACHE_USER') + password = System.getenv('GRADLE_BUILD_CACHE_PASSWORD') + } } }