add vault secret
This commit is contained in:
parent
2204dcc28a
commit
0a3dc19f7c
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -11,8 +11,17 @@ pipeline {
|
||||
stages {
|
||||
stage('Build Kaniko image') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
|
||||
container('kaniko') {
|
||||
withVault([ vaultSecrets: [
|
||||
[
|
||||
path: "ci/general",
|
||||
engineVersion: 1,
|
||||
secretValues: [
|
||||
[envVar: 'NEXUS_TOKEN', vaultKey: 'SONATYPE_DEPLOYMENT_USER_TOKEN']
|
||||
]
|
||||
]
|
||||
]]) {
|
||||
withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
|
||||
container('kaniko') {
|
||||
checkout scm
|
||||
// Setup docker credentials
|
||||
sh 'echo "{\\"auths\\":{\\"https://index.docker.io/v1/\\":{\\"auth\\":\\"$(printf "%s:%s" "$USER" "$PASS" | base64 | tr -d \'\n\')\\"}}}" > /kaniko/.docker/config.json'
|
||||
@ -28,8 +37,9 @@ pipeline {
|
||||
echo ${BRANCH_NAME} | grep -Eo '(release|hotfix)/[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' | grep -Eo '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+' || \
|
||||
echo ${BRANCH_NAME} | grep -Eo 'YASDEV-([[:digit:]]*)')
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user