Commit 4e42930e authored by Philip Welz's avatar Philip Welz Committed by Nick Gaskill

Docs: add CI/CD section for publishing a Helm package

parent 6d377105
...@@ -38,7 +38,7 @@ Once built, a chart can be uploaded to the `stable` channel with `curl` or `helm ...@@ -38,7 +38,7 @@ Once built, a chart can be uploaded to the `stable` channel with `curl` or `helm
```shell ```shell
curl --request POST \ curl --request POST \
--form 'chart=@mychart.tgz' \ --form 'chart=@mychart-0.1.0.tgz' \
--user <username>:<personal_access_token> \ --user <username>:<personal_access_token> \
https://gitlab.example.com/api/v4/projects/1/packages/helm/api/stable/charts https://gitlab.example.com/api/v4/projects/1/packages/helm/api/stable/charts
``` ```
...@@ -50,6 +50,25 @@ Once built, a chart can be uploaded to the `stable` channel with `curl` or `helm ...@@ -50,6 +50,25 @@ Once built, a chart can be uploaded to the `stable` channel with `curl` or `helm
helm push mychart-0.1.0.tgz project-1 helm push mychart-0.1.0.tgz project-1
``` ```
## Use CI/CD to publish a Helm package
To publish a Helm package automated through [GitLab CI/CD](../../../ci/index.md), you can use
`CI_JOB_TOKEN` in place of the personal access token in your commands.
For example:
```yaml
image: curlimages/curl:latest
stages:
- upload
upload:
stage: upload
script:
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@mychart-0.1.0.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
```
## Install a package ## Install a package
To install the latest version of a chart, use the following command: To install the latest version of a chart, use the following command:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment