From 38228ea585889d1f4b7e758b01c8244e329f55fa Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Fri, 20 Jun 2025 22:34:40 +0200 Subject: [PATCH] Add credentials to Jenkinsfile --- Jenkinsfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 54966ac..cf2b20b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,13 @@ pipeline { stages { stage('Gradle') { steps { - sh './gradlew build' + withCredentials([usernamePassword(credentialsId: 'my-credentials-id', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) { + sh """ + ./gradlew build \ + -PalttdSnapshotUsername=$NEXUS_USERNAME \ + -PalttdSnapshotPassword=$NEXUS_PASSWORD + """ + } } } stage('Archive') { @@ -13,8 +19,13 @@ pipeline { } stage('discord') { steps { - discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook + discordSend + description: "Build: ${BUILD_NUMBER}", + showChangeset: true, + result: currentBuild.currentResult, + title: currentBuild.fullProjectName, + webhookURL: env.discordwebhook } } } -} \ No newline at end of file +}