Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Beranek committed Sep 19, 2022
1 parent 8f1edc6 commit 068560a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 60 deletions.
62 changes: 3 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,72 +21,16 @@ To use the plugin, you do not need any special dependencies. The installer will

## Usage

### Single file usage
### Simple usage
```bash
helm set -f <path to values file>
export HELM_VAR_replicaCount=3
helm set upgrade --install --dry-run=false xxx ealenn/echo-server
```

### Multiple files usage
```bash
helm set -f <path to values file> -f <path to values file> -f <path to values file>
```

### Directory usage
The plugin can also be used to recursively substitute environment variables in all the files in a specified directory.
```bash
helm set -f <path to directory>
```

### Mix files and directories
You can also decide to mix files and directories:
```bash
helm set -f <path to values file> -f <path to directory>
```

## Example
Sample helm values file:
```yaml
# values.yaml

image:
repository: $REGISTRY/$IMAGE_NAME
tag: $IMAGE_TAG
```
Environment variables configured in your environment (this should most likely be configured with your CI environment):
```txt
REGISTRY => docker.com
IMAGE_NAME => helm-helm-set
IMAGE_TAG => test
```
Substitute Env:
```bash
helm set -f values.yaml
```
Result:
```yaml
image:
repository: docker.com/helm-helm-set
tag: test
```
**Note:** If the value of the environment variable does not exist, it will be replaced with an empty string. For instance, from the above example, if `IMAGE_TAG` does not exist as an environment variable in the environment the result would have been:

```yaml
image:
repository: docker.com/helm-helm-set
tag:
```

## Uninstall
```bash
helm plugin remove helm-set
```

## Testing locally
To test locally, run the command below to build and run the binary:
> You need to have [Go](https://go.dev/) installed. Make sure to set `$GOPATH`
```bash
go build -o helm-set && ./helm-set -f </path/to/values/file>
```
## License

[MIT](LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "set"
version: "0.0.8"
version: "0.0.9"
usage: "helm set install|upgrade"
description: |-
This plugin provides a way to translate environment variables
Expand Down

0 comments on commit 068560a

Please sign in to comment.