mirror of
https://github.com/harness-community/drone-helm-chart-container-registry.git
synced 2026-06-04 18:24:12 +08:00
readme updated
This commit is contained in:
@@ -1,86 +1,56 @@
|
||||
# Introducing the _drone-push-helm-chart-docker-registry_ Plugin
|
||||
# drone-push-helm-chart-docker-registry
|
||||
|
||||
At Harness, we are always striving to make Continuous Integration (CI) and Continuous Deployment (CD) as smooth and efficient as possible. We understand the importance of managing and deploying Helm charts with ease. That's why we are excited to introduce the drone-push-helm-chart-docker-registry plugin, designed to simplify the packaging and pushing of Helm charts to a Docker registry.
|
||||
- [Synopsis](#Synopsis)
|
||||
- [Parameters](#Paramaters)
|
||||
- [Plugin Image](#Plugin-Image)
|
||||
- [Examples](#Examples)
|
||||
|
||||
### What is the _drone-push-helm-chart-docker-registry_ Plugin?
|
||||
## Synopsis
|
||||
|
||||
The drone-push-helm-chart-docker-registry is a Drone plugin that streamlines the process of packaging and pushing Helm charts to a Docker registry. Helm charts are essential for deploying applications, and this plugin makes it easier than ever to integrate this step into your CI/CD pipeline.
|
||||
This plugin is designed to streamline the packaging and distribution of Helm charts to a Docker registry.
|
||||
|
||||
### Build and Docker Image
|
||||
To learn how to utilize Drone plugins in Harness CI, please consult the provided [documentation](https://developer.harness.io/docs/continuous-integration/use-ci/use-drone-plugins/run-a-drone-plugin-in-ci).
|
||||
|
||||
Building and using the plugin is a straightforward process. You can run the script directly using the following command:
|
||||
## Parameters
|
||||
|
||||
PLUGIN_CHART_NAME=CHART_NAME \
|
||||
PLUGIN_CHART_VERSION=CHART_VERSION \
|
||||
PLUGIN_DOCKER_REGISTRY=DOCKER_REGISTRY \
|
||||
PLUGIN_CHART_PATH=CHART_PATH \
|
||||
PLUGIN_DOCKER_USERNAME=DOCKER_USERNAME \
|
||||
PLUGIN_DOCKER_PASSWORD=DOCKER_PASSWORD \
|
||||
PLUGIN_DOCKER_NAMESPACE+DOCKER_NAMESPACE
|
||||
python main.py
|
||||
| Parameter | Choices/<span style="color:blue;">Defaults</span> | Comments |
|
||||
| :----------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- | :--------------------------------------------------------- |
|
||||
| chart_name <span style="font-size: 10px"><br/>`string`</span> <span style="color:red; font-size: 10px">`required`</span> | | The name of the chart in Chart.yaml |
|
||||
| chart_version <span style="font-size: 10px"><br/>`string`</span> | Defaults: <span style="color:blue;">1.0.0</span> | The project version present in Chart.yaml |
|
||||
| docker_registry <span style="font-size: 10px"><br/>`string`</span> | Defaults: <span style="color:blue;">registry.hub.docker.com</span> | Docker registry where the packaged chart will be published |
|
||||
| chart_path <span style="font-size: 10px"><br/>`string`</span> | Defaults: <span style="color:blue;">`./`</span> | Directory containing the helm chart |
|
||||
| docker_username <span style="font-size: 10px"><br/>`string`</span> <span style="color:red; font-size: 10px">`required`</span> | | Docker username to login to the above registry. |
|
||||
| docker_password <span style="font-size: 10px"><br/>`string`</span> <span style="color:red; font-size: 10px">`required`</span> | | Docker PAT to authenticate |
|
||||
| docker_namespace <span style="font-size: 10px"><br/>`string`</span> <span style="color:red; font-size: 10px">`required`</span> | | Namespace under which the chart will be published |
|
||||
|
||||
Additionally, you can build the Docker image with these commands:
|
||||
## Plugin Image
|
||||
|
||||
docker buildx build -t DOCKER_ORG/drone-helm-chart-docker-registry --platform linux/amd64 .
|
||||
The plugin `harnesscommunity/drone-push-helm-chart-docker-registry` is available for the following architectures:
|
||||
|
||||
This will build the image for the Linux AMD64 platform.
|
||||
| OS | Tag |
|
||||
| ------------- | --------------- |
|
||||
| linux/amd64 | `linux-amd64` |
|
||||
| linux/arm64 | `linux-arm64` |
|
||||
| windows/amd64 | `windows-amd64` |
|
||||
|
||||
### Usage in Harness CI
|
||||
## Examples
|
||||
|
||||
Integrating the drone-push-helm-chart-docker-registry plugin into your Harness CI pipeline is easy. You can use Docker to run the plugin with environment variables. Here's how:
|
||||
|
||||
docker run --rm \
|
||||
-e PLUGIN_CHART_NAME=${CHART_NAME} \
|
||||
-e PLUGIN_CHART_VERSION=${CHART_VERSION} \
|
||||
-e PLUGIN_DOCKER_REGISTRY=${DOCKER_REGISTRY} \
|
||||
-e PLUGIN_CHART_PATH=${CHART_PATH} \
|
||||
-e PLUGIN_DOCKER_USERNAME=${DOCKER_USERNAME} \
|
||||
-e PLUGIN_DOCKER_PASSWORD=${DOCKER_PASSWORD} \
|
||||
-e PLUGIN_DOCKER_NAMESPACE=${DOCKER_NAMESPACE} \
|
||||
-v $(pwd):$(pwd) \
|
||||
-w $(pwd) \
|
||||
harnesscommunity/drone-helm-chart-docker-registry
|
||||
|
||||
In your Harness CI pipeline, you can define the plugin as a step, like this:
|
||||
|
||||
- step:
|
||||
type: Plugin
|
||||
name: helm to docker
|
||||
identifier: helm_to_docker
|
||||
```
|
||||
# Plugin YAML
|
||||
- step:
|
||||
type: Plugin
|
||||
name: Push Helm to Docker
|
||||
identifier: Push_Helm_to_Docker
|
||||
spec:
|
||||
connectorRef: docker-registry-connector
|
||||
image: harnesscommunity/drone-helm-chart-docker-registry
|
||||
settings:
|
||||
chart_name: mywebapp
|
||||
docker_username: <+variable.docker_username>
|
||||
docker_password: <+secrets.getValue("pat-token")>
|
||||
chart_path: path-to-helm-chart
|
||||
chart_version: 1.0.0
|
||||
docker_registry: registry.hub.docker.com
|
||||
docker_namespace: docker-namespace
|
||||
connectorRef: harness-docker-connector
|
||||
image: harnesscommunity/drone-helm-chart-docker-registry:linux-amd64
|
||||
settings:
|
||||
chart_name: mywebapp
|
||||
docker_username: <+variable.docker_username>
|
||||
docker_password: <+secrets.getValue("docker_pat")>
|
||||
chart_path: test
|
||||
chart_version: 5.0.0
|
||||
docker_namespace: <+variable.namespace>
|
||||
```
|
||||
|
||||
#### Plugin Options
|
||||
|
||||
The plugin offers several options for customization:
|
||||
|
||||
- **_-\-chart_name_**: The name of your Helm chart. You should replace ${CHART_NAME} with the actual name of your Helm chart.
|
||||
|
||||
- **_-\-chart_version_**: This variable allows you to specify the version of your Helm chart (default: 1.0.0). You can replace ${CHART_VERSION} with the desired version.
|
||||
|
||||
- **_-\-docker_registry_**: Use this variable to specify the Docker registry where you want to push your Helm chart (default: registry.hub.docker.com). Replace ${DOCKER_REGISTRY} with your preferred registry.
|
||||
|
||||
- **_-\-chart_path_**: This variable is used to define the path to your Helm chart's directory (default: root directory). Replace ${CHART_PATH} with the actual path to your Helm chart.
|
||||
|
||||
- **_-\-docker_username_**: Here, you provide your Docker login username. Replace ${DOCKER_USERNAME} with your Docker username.
|
||||
|
||||
- **_-\-docker_password_**: This variable requires your Docker login password. Replace ${DOCKER_PASSWORD} with your Docker password.
|
||||
|
||||
- **_-\-docker_namespace_**: This allows you to push the packaged chart to a specific namespace.
|
||||
|
||||
These environment variables are essential for configuring and customizing the behavior of the drone-push-helm-chart-docker-registry plugin when it's executed as a Docker container. They allow you to provide specific values and credentials required for the plugin to package and push your Helm chart to the Docker registry of your choice. Make sure to set these variables according to your project's needs.
|
||||
|
||||
## Get Started with the drone-push-helm-chart-docker-registry Plugin
|
||||
|
||||
Whether you are a seasoned DevOps professional or just getting started with CI/CD, the drone-push-helm-chart-docker-registry plugin can streamline your deployment process and help you manage Helm charts effortlessly. Give it a try and see how it simplifies your CI/CD pipelines!
|
||||
|
||||
For more information, documentation, and updates, please visit our GitHub repository: [drone-push-helm-chart-docker-registry](https://github.com/harnesscommunity/drone-push-helm-chart-docker-registry).
|
||||
> <span style="font-size: 14px; margin-left:5px; background-color: #d3d3d3; padding: 4px; border-radius: 4px;">ℹ️ If you notice any issues in this documentation, you can [edit this document](https://github.com/harness-community/drone-push-helm-chart-docker-registry/blob/main/README.md) to improve it.</span>
|
||||
|
||||
Reference in New Issue
Block a user