Commit 2b52ad0c authored by milvus-ci-robot's avatar milvus-ci-robot
Browse files

format Jenkinsfile


Former-commit-id: b6247e2586a5872c65889ff4122df5a676caaec5
parent aba218b1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,9 +8,10 @@ pipeline {
    parameters{
        choice choices: ['Release', 'Debug'], description: '', name: 'BUILD_TYPE'
        string defaultValue: 'cf1434e7-5a4b-4d25-82e8-88d667aef9e5', description: 'GIT CREDENTIALS ID', name: 'GIT_CREDENTIALS_ID', trim: true
        string defaultValue: '1a527823-d2b7-44fd-834b-9844350baf14', description: 'JFROG CREDENTIALS ID', name: 'JFROG_CREDENTIALS_ID', trim: true
        string defaultValue: 'registry.zilliz.com', description: 'DOCKER REGISTRY URL', name: 'DOKCER_REGISTRY_URL', trim: true
        string defaultValue: 'ba070c98-c8cc-4f7c-b657-897715f359fc', description: 'DOCKER CREDENTIALS ID', name: 'DOCKER_CREDENTIALS_ID', trim: true
        string defaultValue: 'http://192.168.1.202/artifactory/milvus', description: 'JFROG ARTFACTORY URL', name: 'JFROG_ARTFACTORY_URL', trim: true
        string defaultValue: '1a527823-d2b7-44fd-834b-9844350baf14', description: 'JFROG CREDENTIALS ID', name: 'JFROG_CREDENTIALS_ID', trim: true
    }

    environment {
+3 −4
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ 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}")
@@ -22,12 +21,12 @@ container('publish-images') {

                def customImage = docker.build("${imageName}")

                def isExistTargeImage = sh(returnStatus: true, script: "docker inspect --type=image ${dockerRegistryURL}/${imageName} 2>&1 > /dev/null")
                def isExistTargeImage = sh(returnStatus: true, script: "docker inspect --type=image ${env.DOKCER_REGISTRY_URL}/${imageName} 2>&1 > /dev/null")
                if (isExistTargeImage == 0) {
                    def removeTargeImageStatus = sh(returnStatus: true, script: "docker rmi ${dockerRegistryURL}/${imageName}")
                    def removeTargeImageStatus = sh(returnStatus: true, script: "docker rmi ${env.DOKCER_REGISTRY_URL}/${imageName}")
                }

                docker.withRegistry("https://${dockerRegistryURL}", "${params.DOCKER_CREDENTIALS_ID}") {
                docker.withRegistry("https://${env.DOKCER_REGISTRY_URL}", "${params.DOCKER_CREDENTIALS_ID}") {
                    customImage.push()
                }
            } catch (exc) {