diff --git a/Jenkinsfile b/Jenkinsfile index 5c4c8c8..3ac5854 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,8 +39,6 @@ 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" @@ -78,8 +76,8 @@ podTemplate( passwordVariable: 'HARBOR_PASSWORD']]) { sh """ docker login -u "${HARBOR_USER}" -p "${HARBOR_PASSWORD}" ${dockerRegistryUrl} - docker build -t ${dockerRegistryUrl}/prototype/${projectName}:${projectVersion} --build-arg PROJECT_NAME=${projectName} --build-arg PROJECT_VERSION=${projectVersion} . - docker push ${dockerRegistryUrl}/prototype/${projectName}:${projectVersion} + docker build -t ${dockerRegistryUrl}/prototype/${env.PROJECT_NAME}:${env.PROJECT_VERSION} --build-arg PROJECT_NAME=${env.PROJECT_NAME} --build-arg PROJECT_VERSION=${env.PROJECT_VERSION} . + docker push ${dockerRegistryUrl}/prototype/${env.PROJECT_NAME}:${env.PROJECT_VERSION} """ } }