Update credentials handling in Gradle and Jenkinsfile for improved security
This commit is contained in:
parent
d76dd403fb
commit
c9b919879a
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
|
|
@ -3,7 +3,12 @@ pipeline {
|
|||
stages {
|
||||
stage('Gradle') {
|
||||
steps {
|
||||
sh './gradlew build'
|
||||
withCredentials([usernamePassword(credentialsId: 'destro-repo-user', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
|
||||
sh '''
|
||||
chmod +x gradlew
|
||||
./gradlew build -PalttdDevPublishUser=$USERNAME -PalttdDevPublishPass=$PASSWORD
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
|
|
@ -17,4 +22,4 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ dependencyResolutionManagement {
|
|||
maven { // mypet
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/MyPetORG/MyPet")
|
||||
credentials(PasswordCredentials::class)
|
||||
credentials {
|
||||
username = providers.gradleProperty("GitHubPackagesUsername").orNull
|
||||
password = providers.gradleProperty("GitHubPackagesPassword").orNull
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user