Repository navigation
How to use a templating tool? something like envsubst #562
Unanswered
lacherogwu
asked this question in
Help needed
Replies: 1 comment
|
You can run the same import { $ } from 'zx';
import { writeFile } from 'node:fs/promises';
for (const name of ['CLUSTER_NAME', 'SECURITY_POLICY_NAME']) {
if (!(name in process.env)) throw new Error(`Missing environment variable: ${name}`);
}
const result = await $`envsubst '$CLUSTER_NAME $SECURITY_POLICY_NAME' < file.yaml`;
await writeFile('rendered.yaml', result.stdout);Set
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Let's say for example I have yaml files with variables
on bash I can do
envsubst < file.yamland have the env vars availableI am interested if there's a recommended way to to it using zx
All reactions