Commit 981b1c1d authored by 卢浩元's avatar 卢浩元

Update Jenkinsfile-withCredentials

parent 59346074
...@@ -57,7 +57,7 @@ podTemplate(cloud: 'kubernetes', containers: [ ...@@ -57,7 +57,7 @@ podTemplate(cloud: 'kubernetes', containers: [
container('docker') { container('docker') {
stage('docker') { stage('docker') {
withCredentials([usernamePassword(credentialsId: 'REGISTRY_URL', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USER')]) { withCredentials([usernamePassword(credentialsId: 'harbor-admin', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USER')]) {
sh "docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${params.REGISTRY_URL}" sh "docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${params.REGISTRY_URL}"
sh "docker build . -t ${params.REGISTRY_URL}/demo/k8s-example:${shortGitCommit}" sh "docker build . -t ${params.REGISTRY_URL}/demo/k8s-example:${shortGitCommit}"
sh "docker push ${params.REGISTRY_URL}/demo/k8s-example:${shortGitCommit}" sh "docker push ${params.REGISTRY_URL}/demo/k8s-example:${shortGitCommit}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment