Corrected insecure usage of environment variables

This commit is contained in:
Teriuihi 2025-06-20 22:50:59 +02:00
parent bbfc9c407c
commit 5fe5a305a5

9
Jenkinsfile vendored
View File

@ -1,17 +1,18 @@
pipeline { pipeline {
agent any agent any
environment {
NEXUS_CREDS = credentials('alttd-snapshot-user')
}
stages { stages {
stage('Gradle') { stage('Gradle') {
steps { steps {
withCredentials([usernamePassword(credentialsId: 'alttd-snapshot-user', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD')]) {
sh """ sh """
./gradlew build \ ./gradlew build \
-PalttdSnapshotUsername=$NEXUS_USERNAME \ -PalttdSnapshotUsername=$NEXUS_CREDS_USR \
-PalttdSnapshotPassword=$NEXUS_PASSWORD -PalttdSnapshotPassword=$NEXUS_CREDS_PSW
""" """
} }
} }
}
stage('Archive') { stage('Archive') {
steps { steps {
archiveArtifacts artifacts: 'build/libs/', followSymlinks: false archiveArtifacts artifacts: 'build/libs/', followSymlinks: false