|
| 1 | +README |
| 2 | + |
1 | 3 | The release-tonpm can be used to publish images to npm.
|
2 | 4 | The below pipeline configuration demonstrates simple usage:
|
3 | 5 |
|
4 |
| -deploy_to_npm: |
5 |
| - title: Publishing To Npm |
6 |
| - image: codefresh/release-tonpm:latest |
7 |
| - commands: |
8 |
| - - NPM_TOKEN=${{NPM_TOKEN}} npm run ci-publish |
9 |
| - when: |
10 |
| - branch: |
11 |
| - only: [ master ] |
12 |
| - |
13 |
| - |
14 |
| -Login into your project's NPM registry |
| 6 | + deploy_to_npm: |
| 7 | + |
| 8 | + title: Publishing To Npm |
| 9 | + image: codefresh/npm-publish:master |
| 10 | + commands: |
| 11 | + - NPM_TOKEN=${{NPM_TOKEN}} npm run ci-publish |
| 12 | + when: |
| 13 | + branch: |
| 14 | + only: [ master ] |
| 15 | + |
| 16 | + |
| 17 | +Parameter Reference |
| 18 | + |
| 19 | +-NPM_TOKEN |
| 20 | + |
| 21 | +-npm access key |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + Login into your project's NPM registry |
15 | 26 |
|
16 |
| -npm login --registry <registry url> |
17 |
| -npm login --registry http://registry.npmjs.org |
| 27 | + npm login --registry <registry url> |
| 28 | + npm login --registry http://registry.npmjs.org |
18 | 29 |
|
19 |
| -Copy the token |
20 |
| -The login step added a line to your ~/.npmrc file looking something like this |
| 30 | + Copy the token |
| 31 | + The login step added a line to your ~/.npmrc file looking something like this |
21 | 32 |
|
22 |
| -//registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000 |
| 33 | + //registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000 |
23 | 34 |
|
24 |
| -Grab the auth token value 00000000-0000-0000-0000-000000000000 (older NPM proxies or registries like sinopia might have an older different token string format) |
| 35 | + Grab the auth token value 00000000-0000-0000-0000-000000000000 (older NPM proxies or registries like sinopia might have an older different token string format) |
25 | 36 |
|
26 |
| -Set the token as CI environment variable |
27 |
| -Go to your CI project settings and add a new variable NPM_TOKEN with the value you have just copied |
| 37 | + Set the token as CI environment variable |
| 38 | + Go to your CI project settings and add a new variable NPM_TOKEN with the value you have just copied |
0 commit comments