Add credentials to Jenkinsfile

This commit is contained in:
Teriuihi 2025-06-20 22:34:40 +02:00
parent b65fcdb1c7
commit 38228ea585

17
Jenkinsfile vendored
View File

@ -3,7 +3,13 @@ pipeline {
stages { stages {
stage('Gradle') { stage('Gradle') {
steps { 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') { stage('Archive') {
@ -13,8 +19,13 @@ pipeline {
} }
stage('discord') { stage('discord') {
steps { 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
} }
} }
} }
} }