Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ function deleteCmd(helm, namespace, release) {
return ["delete", "--purge", release];
}

/**
* Takes in a secret value and decodes it from base64.
*
* @param {string} secretVal
*/
function parseBase64(secretVal) {
return Buffer.from(secretVal, 'base64').toString('utf-8');
}

/**
* Run executes the helm deployment.
*/
Expand Down Expand Up @@ -227,6 +236,9 @@ async function run() {
if (process.env.KUBECONFIG_FILE) {
process.env.KUBECONFIG = "./kubeconfig.yml";
await writeFile(process.env.KUBECONFIG, process.env.KUBECONFIG_FILE);
} else if (process.env.KUBECONFIG_BASE64) {
process.env.KUBECONFIG = "./kubeconfig.yml";
await writeFile(process.env.KUBECONFIG, parseBase64(process.env.KUBECONFIG_BASE64));
}
await writeFile("./values.yml", values);

Expand Down