https://github.com/unfunco/envsub
CLI tool designed to simplify the process of placeholder replacement.
https://github.com/unfunco/envsub
cli-tool env-vars environment-variables envsubst interpolation linux macos rust substitution
Last synced: 2 months ago
JSON representation
CLI tool designed to simplify the process of placeholder replacement.
- Host: GitHub
- URL: https://github.com/unfunco/envsub
- Owner: unfunco
- License: apache-2.0
- Created: 2019-10-21T19:30:17.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T17:15:28.000Z (about 2 years ago)
- Last Synced: 2025-02-07T14:40:21.768Z (4 months ago)
- Topics: cli-tool, env-vars, environment-variables, envsubst, interpolation, linux, macos, rust, substitution
- Language: Rust
- Homepage:
- Size: 41 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# envsub
**WIP**
CLI tool designed to simplify the process of placeholder replacement in
text files. It's similar to [envsubst] in that it is primarily used for
injecting environment variables into configuration files.## Getting started
### Installation
TODO
### Usage
```yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx:${NGINX_VERSION}
name: nginx
ports:
- containerPort: ${PORT | default(80)}
restartPolicy: Never
``````bash
NGINX_VERSION=1.23.4 envsub < manifest.yaml
``````yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx:1.23.4
name: nginx
ports:
- containerPort: 80
restartPolicy: Never
```### Filters
| Filter | Description |
|-----------------:|------------------------------------------------------------------|
| `default(value)` | Replaces the input with the default value if the input is empty. |
| `lowercase` | Transforms the characters in the input to lower case. |
| `trim` | Removes whitespace from the start and end of the input. |
| `uppercase` | Transforms the characters in the input to upper case. |## License
© 2019 [Daniel Morris](https://unfun.co)
Made available under the terms of the [Apache License 2.0](LICENSE.md).[envsubst]: https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html