File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 1+ # Codefresh release-to-npm Plugin
2+
3+ The release-to-npm can be used to publish images to npm.
4+
5+ ## Usage
6+
7+ Set required and optional environment variable and add the following step to your Codefresh pipeline:
8+
9+ ``` yaml
10+ ---
11+ version : ' 1.0'
12+
13+ steps :
14+
15+ ...
16+
17+ deploy_to_npm :
18+ title : Publishing To Npm
19+ image : codefresh/release-to-npm
20+ commands :
21+ - NPM_TOKEN=${{NPM_TOKEN}} npm run release-to-npm
22+ ...
23+
24+ ```
25+
26+ ## Environment Variables
27+
28+ - ** required** ` NPM_TOKEN ` - token of npm account
29+
30+ ## How to use
31+
32+ - Add as a dependency to your project ` npm install --save-dev release-to-npm `
33+
34+ - Login into your project's NPM registry
35+
36+ ```
37+ npm login --registry <registry url>
38+ npm login --registry http://registry.npmjs.org
39+ ```
40+
41+ - Copy the token
42+
43+ see how to extracting the NPM_TOKEN https://docs.npmjs.com/private-modules/ci-server-config#getting-an-authentication-token
44+
45+ - Set the token as environment variable
46+
47+ - Add script command
48+
49+ Create a script command to run the release-to-npm, in your ` package.json `
50+
51+ ``` json
52+ {
53+ "scripts" : {
54+ "release-to-npm" : " release-to-npm"
55+ }
56+ }
57+ ```
58+
59+
60+
61+
Original file line number Diff line number Diff line change 1+ version : ' 1.0'
2+ steps :
3+ BuildingDockerImage :
4+ title : Building Docker Image
5+ type : build
6+ image_name : zivcodefresh/npmtest
7+ working_directory : ./
8+ dockerfile : Dockerfile
9+ tag : ' ${{CF_BRANCH_TAG_NORMALIZED}}'
10+ deploy_to_npm :
11+ title : Publishing To Npm
12+ image : codefresh/release-to-npm
13+ commands :
14+ - NPM_TOKEN=${{NPM_TOKEN}} npm run release-to-npm
You can’t perform that action at this time.
0 commit comments