Commit f5308330 authored by daidekun's avatar daidekun

增加构建函数

parent 0daac027
...@@ -141,10 +141,10 @@ def dockerbuild_and_push(buildNumber, branchName, harborGroup, systemName, conte ...@@ -141,10 +141,10 @@ def dockerbuild_and_push(buildNumber, branchName, harborGroup, systemName, conte
safeSystemName = "project" safeSystemName = "project"
imageTag = "192.168.4.36/${harborGroup}/${systemName}:${safeBranchName}-${buildNumber}" imageTag = "192.168.4.36/${harborGroup}/${systemName}:${safeBranchName}-${buildNumber}"
withDockerServer([uri: "tcp://192.168.4.96:2375/"]) { withDockerServer([uri: "tcp://192.168.4.96:2375/"]) {
withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) { withDockerRegistry([credentialsId: 'harbor-qajenkins', url: "http://192.168.4.36"]) {
def image = docker.build(imageTag, "--build-arg BUILD_NUMBER=${buildNumber} --build-arg SYSTEM_NAME=${safeSystemName} ${contextDir}") def image = docker.build(imageTag, "--build-arg BUILD_NAME=${buildNumber} --build-arg SYSTEM_NAME=${systemName} --build-arg= BRANCH_NAME=${branchName} --build-arg SAFE_SYSTEM_NAME=${safeSystemName} ${contextDir}")
image.push() image.push()
image.push('latest') image.push('latest')
} }
......
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