From a62cee565cd8ea4632fcfd1ac478e2f085cdbc3a Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 1 Feb 2023 23:36:14 +0000 Subject: [PATCH] environment test --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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} """ } }