Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

NPM pipeline ignores scoped deployment

Phillip Markwick August 10, 2019

I am trying to use a pipeline to deploy an angular 8 library to npm using the npm bitbucket pipeline.

bitbucket-pipelines.yml:

image: node:10.15.3

pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm install -g @angular/cli
- ng build ph-ux
- pipe: atlassian/npm-publish:0.2.4
variables:
NPM_TOKEN: '<token value removed>'
FOLDER: './dist/ph-ux'
NPM_REGISTRY_URL: 'https://registry.npmjs.org/@mwksolutions/'

 

fails on the npm-publish pipe with:

+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/npm-publish:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/npm-publish \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=CI="$CI" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/npm-publish" \
--env=FOLDER="./dist/ph-ux" \
--env=NPM_REGISTRY_URL="https://registry.npmjs.org/@mwksolutions/" \
--env=NPM_TOKEN="<token value removed>" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/npm-publish:0.2.4
Unable to find image 'bitbucketpipelines/npm-publish:0.2.4' locally
0.2.4: Pulling from bitbucketpipelines/npm-publish
e7c96db7181b: Pulling fs layer
bbec46749066: Pulling fs layer
89e5cf82282d: Pulling fs layer
5de6895db72f: Pulling fs layer
538acdc5a229: Pulling fs layer
b99984164dc1: Pulling fs layer
cade7920587c: Pulling fs layer
4d3b170fc95c: Pulling fs layer
b99984164dc1: Waiting
cade7920587c: Waiting
4d3b170fc95c: Waiting
538acdc5a229: Waiting
5de6895db72f: Waiting
e7c96db7181b: Verifying Checksum
e7c96db7181b: Download complete
89e5cf82282d: Verifying Checksum
89e5cf82282d: Download complete
e7c96db7181b: Pull complete
5de6895db72f: Verifying Checksum
5de6895db72f: Download complete
bbec46749066: Verifying Checksum
bbec46749066: Download complete
538acdc5a229: Download complete
b99984164dc1: Download complete
cade7920587c: Verifying Checksum
cade7920587c: Download complete
4d3b170fc95c: Verifying Checksum
4d3b170fc95c: Download complete
bbec46749066: Pull complete
89e5cf82282d: Pull complete
5de6895db72f: Pull complete
538acdc5a229: Pull complete
b99984164dc1: Pull complete
cade7920587c: Pull complete
4d3b170fc95c: Pull complete
Digest: sha256:a9ae25bd777328702b6649087152d6b8123421e233c0246835c8abd5a8b8a44b
Status: Downloaded newer image for bitbucketpipelines/npm-publish:0.2.4
INFO: Starting pipe execution...
INFO: Registry URL: https://registry.npmjs.org
INFO: Setting npm auth configuration...
INFO: Publishing package...
npm publish ./dist/ph-ux
npm notice
npm notice package: ph-ux@0.0.2
npm notice === Tarball Contents ===
npm notice 492B package.json
npm notice 193B ph-ux.d.ts
npm notice 2.1kB ph-ux.metadata.json
npm notice 147B public-api.d.ts
npm notice 978B README.md
npm notice 4.8kB bundles/ph-ux.umd.js
npm notice 2.6kB bundles/ph-ux.umd.js.map
npm notice 1.5kB bundles/ph-ux.umd.min.js
npm notice 2.6kB bundles/ph-ux.umd.min.js.map
npm notice 1.4kB esm2015/lib/ph-ux.component.js
npm notice 1.8kB esm2015/lib/ph-ux.module.js
npm notice 1.5kB esm2015/lib/ph-ux.service.js
npm notice 637B esm2015/lib/visit/model/index.js
npm notice 1.2kB esm2015/lib/visit/model/visit.js
npm notice 2.2kB esm2015/lib/visit/visit-short-summary/visit-short-summary.component.js
npm notice 1.0kB esm2015/ph-ux.js
npm notice 1.0kB esm2015/public-api.js
npm notice 1.7kB esm5/lib/ph-ux.component.js
npm notice 2.0kB esm5/lib/ph-ux.module.js
npm notice 1.8kB esm5/lib/ph-ux.service.js
npm notice 637B esm5/lib/visit/model/index.js
npm notice 1.3kB esm5/lib/visit/model/visit.js
npm notice 2.5kB esm5/lib/visit/visit-short-summary/visit-short-summary.component.js
npm notice 1.0kB esm5/ph-ux.js
npm notice 1.0kB esm5/public-api.js
npm notice 3.1kB fesm2015/ph-ux.js
npm notice 2.5kB fesm2015/ph-ux.js.map
npm notice 3.8kB fesm5/ph-ux.js
npm notice 2.5kB fesm5/ph-ux.js.map
npm notice 138B lib/ph-ux.component.d.ts
npm notice 36B lib/ph-ux.module.d.ts
npm notice 89B lib/ph-ux.service.d.ts
npm notice 51B lib/visit/model/index.d.ts
npm notice 134B lib/visit/model/visit.d.ts
npm notice 209B lib/visit/visit-short-summary/visit-short-summary.component.d.ts
npm notice === Tarball Details ===
npm notice name: ph-ux
npm notice version: 0.0.2
npm notice package size: 10.2 kB
npm notice unpacked size: 50.8 kB
npm notice shasum: 7b47e51c1d004f469817aaa75d27cfdf5a7fbcdf
npm notice integrity: sha512-0RP/lBPL/fDs0[...]G0EPtpYPOfr+A==
npm notice total files: 35
npm notice
npm ERR! code E403
npm ERR! 403 Forbidden - PUT https://registry.npmjs.org/ph-ux - Package name too similar to existing packages; try renaming your package to '@phillipmarkwick/ph-ux' and publishing with 'npm publish --access=public' instead
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-08-10T22_09_23_128Z-debug.log
✖ Failed to publish package "ph-ux@0.0.2".

 

1 answer

0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2019

Hi @Phillip Markwick . Could you try to rerun the pipe with debug mode enabled to get a bit more info about what's going on during the pipe execution? To enable debug mode add the DEBUG pipe variable to :

- pipe: atlassian/npm-publish:0.2.4
variables:
NPM_TOKEN: '<token value removed>'
FOLDER: './dist/ph-ux'
NPM_REGISTRY_URL: 'https://registry.npmjs.org/@mwksolutions/'
DEBUG: 'true'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events