mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 05:55:51 +00:00
leaked username
This commit is contained in:
parent
da1ed63bde
commit
7b3b3b8485
1 changed files with 11 additions and 21 deletions
32
Jenkinsfile
vendored
32
Jenkinsfile
vendored
|
@ -23,20 +23,6 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Cred'){
|
||||
steps {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: "580b959d-d40a-422f-a3d7-cf11b2ec7a4c",
|
||||
usernameVariable: 'DOCKER_USER',
|
||||
passwordVariable: 'DOCKER_PASS',
|
||||
)]) {
|
||||
echo "Logging in to Docker Hub..."
|
||||
sh "echo ${env.DOCKER_USER}"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
|
@ -45,14 +31,18 @@ pipeline {
|
|||
def imageTag = "${DOCKER_HUB_USER}/${dockerRepo}:${GIT_COMMIT_SHORT}"
|
||||
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: DOCKERHUB_CREDS,
|
||||
usernameVariable: 'DOCKER_USER',
|
||||
passwordVariable: 'DOCKER_PASS'
|
||||
credentialsId: DOCKERHUB_CREDS,
|
||||
usernameVariable: 'DOCKER_USER',
|
||||
passwordVariable: 'DOCKER_PASS'
|
||||
)]) {
|
||||
echo "Logging in to Docker Hub..."
|
||||
sh "echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin"
|
||||
echo "Pushing Docker image to ${imageTag}"
|
||||
sh "docker push ${imageTag}"
|
||||
echo "Logging in to Docker Hub..."
|
||||
sh 'echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin'
|
||||
|
||||
echo "Building Docker image ${imageTag}..."
|
||||
sh "docker build -t ${imageTag} ."
|
||||
|
||||
echo "Pushing Docker image ${imageTag}..."
|
||||
sh "docker push ${imageTag}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue