Skip to content

Commit

Permalink
Merge pull request #5 from vimeda/move-process-config-to-main
Browse files Browse the repository at this point in the history
Extract process config to main function
  • Loading branch information
mpraski authored Jan 26, 2021
2 parents 3dd2a4b + 514898b commit 88012c5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ async function deploy(helm) {
`--namespace=${namespace}`,
];

process.env.XDG_DATA_HOME = "/root/.helm/"
process.env.XDG_CACHE_HOME = "/root/.helm/"
process.env.XDG_CONFIG_HOME = "/root/.helm/"

if (dryRun) args.push("--dry-run");
if (appName) args.push(`--set=app.name=${appName}`);
if (version) args.push(`--set=app.version=${version}`);
Expand All @@ -257,12 +253,6 @@ async function deploy(helm) {
args.push("--atomic");
}

// Setup necessary files.
if (process.env.KUBECONFIG_FILE) {
process.env.KUBECONFIG = "./kubeconfig.yml";
await writeFile(process.env.KUBECONFIG, process.env.KUBECONFIG_FILE);
}

await writeFile("./values.yml", values);

core.debug(`env: KUBECONFIG="${process.env.KUBECONFIG}"`);
Expand Down Expand Up @@ -300,6 +290,16 @@ async function run() {
try {
await status("pending");

process.env.XDG_DATA_HOME = "/root/.helm/"
process.env.XDG_CACHE_HOME = "/root/.helm/"
process.env.XDG_CONFIG_HOME = "/root/.helm/"

// Setup necessary files.
if (process.env.KUBECONFIG_FILE) {
process.env.KUBECONFIG = "./kubeconfig.yml";
await writeFile(process.env.KUBECONFIG, process.env.KUBECONFIG_FILE);
}

const helm = getInput("helm") || "helm3";
core.debug(`param: helm = "${helm}"`);

Expand Down

0 comments on commit 88012c5

Please sign in to comment.