File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,17 +6,19 @@ stage('publish') {
66 env. TAG_NAME = shWithReturn(' git describe --exact-match --tags HEAD || :' );
77
88 if (isTagBuild()) {
9- env. DOCKER_TAG = dockerTag(env. TAG_NAME . substring(0 , env. TAG_NAME . length() - 1 ));
9+ env. TAG_NAME = env. TAG_NAME . substring(0 , env. TAG_NAME . length() - 1 );
10+ env. DOCKER_TAG = dockerTag(env. TAG_NAME );
1011 env. NPM_TAG = ' stable' ;
1112 } else {
13+ env. TAG_NAME = " " ;
1214 env. DOCKER_TAG = " " ;
1315 env. NPM_TAG = " " ;
1416 }
1517
1618 if (env. DOCKER_TAG != " " ) {
1719 withCredentials([string(credentialsId : ' npm-token' , variable : ' NPM_TOKEN' )]) {
1820 sh ' sudo -E docker build --build-arg NPM_TOKEN=$NPM_TOKEN -t ${DOCKER_TAG} .' ;
19- sh ' sudo -E docker run -e "NPM_TOKEN=$NPM_TOKEN" ${DOCKER_TAG} bash -c "npm --no-git-tag-version version ${DOCKER_TAG } && npm publish --tag ${NPM_TAG}"' ;
21+ sh ' sudo -E docker run -e "NPM_TOKEN=$NPM_TOKEN" ${DOCKER_TAG} bash -c "npm --no-git-tag-version version ${TAG_NAME } && npm publish --tag ${NPM_TAG}"' ;
2022 sh " sudo -E docker push ${ DOCKER_TAG} " ;
2123 }
2224 }
You can’t perform that action at this time.
0 commit comments