|
1 |
| -README |
| 1 | +# Codefresh Helm Plugin |
2 | 2 |
|
3 |
| -The release-tonpm can be used to publish images to npm. |
4 |
| -The below pipeline configuration demonstrates simple usage: |
| 3 | +Use Codefresh [Helm](https://helm.sh) plugin to deploy a Helm chart into specified (by context) Kubernetes cluster. |
5 | 4 |
|
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 ] |
| 5 | +## Usage |
15 | 6 |
|
| 7 | +Set required and optional environment variable and add the following step to your Codefresh pipeline: |
16 | 8 |
|
17 |
| -Parameter Reference |
| 9 | +```yaml |
| 10 | +--- |
| 11 | +version: '1.0' |
18 | 12 |
|
19 |
| --NPM_TOKEN |
| 13 | +steps: |
20 | 14 |
|
21 |
| --npm access key |
| 15 | + ... |
22 | 16 |
|
23 |
| - |
24 |
| - |
25 |
| - Login into your project's NPM registry |
| 17 | + release_to_env: |
| 18 | + image: codefresh/plugin-helm:2.7.2 |
26 | 19 |
|
27 |
| - npm login --registry <registry url> |
28 |
| - npm login --registry http://registry.npmjs.org |
| 20 | + ... |
29 | 21 |
|
30 |
| - Copy the token |
31 |
| - The login step added a line to your ~/.npmrc file looking something like this |
| 22 | +``` |
32 | 23 |
|
33 |
| - //registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000 |
| 24 | +## Environment Variables |
34 | 25 |
|
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) |
36 |
| - |
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 |
| 26 | +- **required** `CHART_NAME` - Helm chart name |
| 27 | +- **required** `RELEASE_NAME` - Helm release name |
| 28 | +- **required** `KUBE_CONTEXT` - Kubernetes context to use (cluster name from Codefresh-Kubernetes integration) |
| 29 | +- `NAMESPACE` - target Kubernetes namespace |
| 30 | +- `CHART_VERSION` - application chart version to install |
| 31 | +- `CHART_REPO_URL` - Helm chart repository URL |
| 32 | +- `DRY_RUN` - do a "dry run" installation (do not install anything, useful for Debug) |
| 33 | +- `DEBUG` - print verbose install output |
| 34 | +- `WAIT` - block step execution till installation completed and all Kubernetes resources are ready |
| 35 | +- `TIMEOUT` - wait timeout (5min by default) |
0 commit comments