diff --git a/README.md b/README.md index 6ae85d2..628e283 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,29 @@ -A plugin to drone plugin to package and publish helm charts. +# drone-helm-chart-container-registry -# Usage +- [Synopsis](#Synopsis) +- [Parameters](#Paramaters) +- [Notes](#Notes) +- [Plugin Image](#Plugin-Image) +- [Examples](#Examples) -The following settings changes this plugin's behavior. +## Synopsis -- param1 (optional) does something. -- param2 (optional) does something different. +This plugin is designed to streamline the packaging and distribution of Helm charts to a Container registry. -Below is an example `.drone.yml` that uses this plugin. +Currently, it supports pushing Helm charts to Docker Hub and Google Artifact Registry. -```yaml -kind: pipeline -name: default +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). -steps: - - name: run harnesscommunity/drone-helm-chart-container-registry plugin - image: harnesscommunity/drone-helm-chart-container-registry - pull: if-not-exists - settings: - param1: foo - param2: bar -``` +## Parameters -# Building - -Build the plugin binary: - -```text -scripts/build.sh -``` - -Build the plugin image: - -```text -docker build -t harnesscommunity/drone-helm-chart-container-registry -f docker/Dockerfile . -``` - -# Testing - -Execute the plugin from your current working directory: - -```text -docker run --rm -e PLUGIN_PARAM1=foo -e PLUGIN_PARAM2=bar \ - -e DRONE_COMMIT_SHA=8f51ad7884c5eb69c11d260a31da7a745e6b78e2 \ - -e DRONE_COMMIT_BRANCH=master \ - -e DRONE_BUILD_NUMBER=43 \ - -e DRONE_BUILD_STATUS=success \ - -w /drone/src \ - -v $(pwd):/drone/src \ - harnesscommunity/drone-helm-chart-container-registry -``` - -"font-size: 10px">
`string` `required` | | Docker registry where the packaged chart will be published | -| chart_path
`string`
`required` | | Directory containing the helm chart | -| registry_username
`string`
`required` | | Username to login to the above registry. | -| registry_password
`string`
`required` | | PAT / access token to authenticate | -| registry_namespace
`string`
`required` | | Namespace under which the chart will be published | -| gcloud_project_id
`string`
| | Google Artifact Repository project ID | +| Parameter | Choices/Defaults | Comments | +| :------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------ | :--------------------------------------------------------- | +| registry_url
`string`
`required` | | Docker registry where the packaged chart will be published | +| chart_path
`string`
`required` | | Directory containing the helm chart | +| registry_username
`string`
`required` | | Username to login to the above registry. | +| registry_password
`string`
`required` | | PAT / access token to authenticate | +| registry_namespace
`string`
`required` | | Namespace under which the chart will be published | +| gcloud_project_id
`string`
| | Google Artifact Repository project ID | ## Notes diff --git a/plugin/plugin.go b/plugin/plugin.go index 7f43441..309b8f2 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -28,7 +28,7 @@ type Args struct { Password string `envconfig:"PLUGIN_REGISTRY_PASSWORD"` ChartPath string `envconfig:"PLUGIN_CHART_PATH"` Namespace string `envconfig:"PLUGIN_REGISTRY_NAMESPACE"` - ProjectId string `envconfig:"PLUGIN_PROJECT_ID"` + ProjectId string `envconfig:"PLUGIN_GCLOUD_PROJECT_ID"` } // Exec executes the plugin.