diff --git a/Jenkinsfile b/Jenkinsfile index 71fa3aa..5c4c8c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,6 +39,8 @@ podTemplate( def myRepo = checkout scm def gitCommit = myRepo.GIT_COMMIT def gitBranch = myRepo.GIT_BRANCH + def projectName = myRepo.PROJECT_NAME + def projectVersion = myRepo.PROJECT_VERSION def shortGitCommit = "${gitCommit[0..10]}" def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true) def dockerRegistryUrl = "harbor.loafle.net" @@ -76,8 +78,8 @@ podTemplate( passwordVariable: 'HARBOR_PASSWORD']]) { sh """ docker login -u "${HARBOR_USER}" -p "${HARBOR_PASSWORD}" ${dockerRegistryUrl} - docker build -t ${dockerRegistryUrl}/prototype/${PROJECT_NAME}:${PROJECT_VERSION} --build-arg PROJECT_NAME=${PROJECT_NAME} --build-arg PROJECT_VERSION=${PROJECT_VERSION} . - docker push ${dockerRegistryUrl}/prototype/${PROJECT_NAME}:${PROJECT_VERSION} + docker build -t ${dockerRegistryUrl}/prototype/${projectName}:${projectVersion} --build-arg PROJECT_NAME=${projectName} --build-arg PROJECT_VERSION=${projectVersion} . + docker push ${dockerRegistryUrl}/prototype/${projectName}:${projectVersion} """ } }