更新 'Jenkinsfile'

main
newrain001 9 months ago
parent 1a2bb24d78
commit cf329b8d24
  1. 6
      Jenkinsfile

6
Jenkinsfile vendored

@ -2,7 +2,7 @@ pipeline {
agent any
environment {
DOCKER_IMAGE = "my-web-app:latest"
docker_image = "my-web-app:latest"
K8S_DEPLOYMENT_NAME = "my-web-app-deployment"
}
@ -10,7 +10,7 @@ pipeline {
stage('构建镜像') {
steps {
script {
docker.build("${DOCKER_IMAGE}")
docker.build("${docker_image}")
}
}
}
@ -19,7 +19,7 @@ pipeline {
script {
// 假设已经配置了 Docker 认证
docker.withRegistry('http://core.harbor.cn', 'registry-credentials') {
docker.image("${DOCKER_IMAGE}").push()
docker.image("${docker_image}").push()
}
}
}

Loading…
Cancel
Save