提交 ee546c00 编写于 作者: T test

update ci/jenkins/jenkinsfile/publishImages.groovy


Former-commit-id: f711eef346959df69b3c0381f7138ba1bc0b50d5
上级 c28b1da7
......@@ -2,6 +2,8 @@ container('publish-images') {
timeout(time: 15, unit: 'MINUTES') {
dir ("docker/deploy/${OS_NAME}") {
def binaryPackage = "${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz"
def dockerRegistryURL = "registry.zilliz.com"
withCredentials([usernamePassword(credentialsId: "${params.JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USERNAME', passwordVariable: 'JFROG_PASSWORD')]) {
def downloadStatus = sh(returnStatus: true, script: "curl -u${JFROG_USERNAME}:${JFROG_PASSWORD} -O ${params.JFROG_ARTFACTORY_URL}/milvus/package/${binaryPackage}")
......@@ -17,14 +19,29 @@ container('publish-images') {
if (isExistImage == 0) {
sh "docker rmi ${imageName}"
}
def customImage = docker.build("${imageName}")
docker.withRegistry('https://registry.zilliz.com', "${params.DOCKER_CREDENTIALS_ID}") {
isExistImage = sh(returnStatus: true, script: "docker inspect --type=image ${dockerRegistryURL}/${imageName}")
if (isExistImage == 0) {
sh "docker rmi ${dockerRegistryURL}/${imageName}"
}
docker.withRegistry("${dockerRegistryURL}", "${params.DOCKER_CREDENTIALS_ID}") {
customImage.push()
}
} catch (exc) {
throw exc
} finally {
sh "docker rmi ${imageName}"
def isExistImage = sh(returnStatus: true, script: "docker inspect --type=image ${imageName}")
if (isExistImage == 0) {
sh "docker rmi ${imageName}"
}
isExistImage = sh(returnStatus: true, script: "docker inspect --type=image ${dockerRegistryURL}/${imageName}")
if (isExistImage == 0) {
sh "docker rmi ${dockerRegistryURL}/${imageName}"
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册