diff --git a/Jenkinsfile b/Jenkinsfile index 21c7446b..e88f9dfd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,11 +27,6 @@ pipeline { } parameters { - booleanParam( - name: 'ONLY_PUSH_MLOPS_SCORER', - defaultValue: true, - description: "Whether to only push MLOps Scorer to remote container registry." - ) booleanParam( name: 'PUSH_TO_HARBOR', defaultValue: false, @@ -174,20 +169,14 @@ pipeline { def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withDockerCredentials("harbor.h2o.ai", "TO_") { - def cmd = "./gradlew --init-script init.gradle " - if (params.ONLY_PUSH_MLOPS_SCORER) { - cmd += ":local-rest-scorer:jib " - } else { - cmd += "jib " - } - cmd += "-Djib.to.auth.username=${TO_DOCKER_USERNAME} \ + sh "./gradlew --init-script init.gradle jib \ + -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ -Djib.to.tags=${imageTags} \ -Djib.allowInsecureRegistries=true \ -DsendCredentialsOverHttp=true" - sh cmd } } } @@ -212,23 +201,17 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES') { script { - def cmd = "./gradlew --init-script init.gradle " - if (params.ONLY_PUSH_MLOPS_SCORER) { - cmd += ":local-rest-scorer:jib " - } else { - cmd += "jib " - } def gitCommitHash = env.GIT_COMMIT def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withDockerCredentials(DOCKERHUB_CREDS, "TO_") { - cmd += "-Djib.to.auth.username=${TO_DOCKER_USERNAME} \ + sh "./gradlew --init-script init.gradle jib \ + -Djib.to.auth.username=${TO_DOCKER_USERNAME} \ -Djib.to.auth.password=${TO_DOCKER_PASSWORD} \ -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ -Djib.to.tags=${imageTags} \ -PdockerRepositoryPrefix=h2oai/" - sh cmd } } } @@ -253,23 +236,17 @@ pipeline { steps { timeout(time: 30, unit: 'MINUTES') { script { - def cmd = "./gradlew --init-script init.gradle --stacktrace " - if (params.ONLY_PUSH_MLOPS_SCORER) { - cmd += ":local-rest-scorer:jib " - } else { - cmd += "jib " - } def gitCommitHash = env.GIT_COMMIT def imageTags = isMasterBranch() || isReleaseBranch() ? "${versionText},${gitCommitHash}" : "${gitCommitHash}" withDockerCredentials(DOCKERHUB_CREDS, "FROM_") { withGCRCredentials(VORVAN_CRED) { def gcrCreds = readFile("${GCR_JSON_KEY}") withEnv(['TO_DOCKER_USERNAME=_json_key', "TO_DOCKER_PASSWORD=${gcrCreds}"]) { - cmd += "-Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ + sh "./gradlew --init-script init.gradle jib \ + -Djib.from.auth.username=${FROM_DOCKER_USERNAME} \ -Djib.from.auth.password=${FROM_DOCKER_PASSWORD} \ -Djib.to.tags=${imageTags} \ -PdockerRepositoryPrefix=gcr.io/vorvan/h2oai/" - sh cmd } } }