a8m / a8m/envsubst

Feature Request - Loop by pattern matching.

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
907
Forks
96
PR merge metrics
No merged PRs in 30d

Description

I have a case where I need to create multiple entries in a config file based on the existence of environment variables. (its for a reverse proxy and I want to be able to add new entries simply by adding additional environment variables)

Something like:

**Env Vars:**
```
SRVCS_FIRST_HOSTNAME=sample.service.com
SRVCS_FIRST_DEST=internal.server.name
SRVCS_SECOND_HOSTNAME=second.service.com
SRVCS_SECOND_DEST=internal2.server.name
```

**Template:**
```
${SRVCS_*_<
host: ${HOSTNAME}
destination: ${DEST}

>}
```

**Result:**
```
host: sample.service.com
destination: internal.server.name

host: second.service.com
destination: internal2.server.name

```

Any thoughts on this idea? _I_ think it'd be pretty handy.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.