Skip to content

Commit

Permalink
feat: Add timeout parameter (#18)
Browse files Browse the repository at this point in the history
Timeout parameter passed along to helm command.
  • Loading branch information
marudor authored and colinjfw committed Dec 24, 2019
1 parent a58b37b commit d494b05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ payload if the action was triggered by a deployment.
JSON encoded map.
- `helm`: Helm binary to execute, one of: [`helm`, `helm3`].
- `version`: Version of the app, usually commit sha works here.
- `timeout`: specify a timeout for helm deployment

Additional parameters: If the action is being triggered by a deployment event
and the `task` parameter in the deployment event is set to `"remove"` then this
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ async function run() {
const valueFiles = getValueFiles(getInput("value_files"));
const removeCanary = getInput("remove_canary");
const helm = getInput("helm") || "helm";
const timeout = getInput("timeout");

const dryRun = core.getInput("dry-run");
const secrets = getSecrets(core.getInput("secrets"));
Expand All @@ -180,6 +181,7 @@ async function run() {
core.debug(`param: secrets = "${JSON.stringify(secrets)}"`);
core.debug(`param: valueFiles = "${JSON.stringify(valueFiles)}"`);
core.debug(`param: removeCanary = ${removeCanary}`);
core.debug(`param: timeout = "${timeout}`);

// Setup command options and arguments.
const opts = { env: {
Expand All @@ -197,6 +199,7 @@ async function run() {
if (dryRun) args.push("--dry-run");
if (appName) args.push(`--set=app.name=${appName}`);
if (version) args.push(`--set=app.version=${version}`);
if (timeout) args.push(`--timeout=${timeout}`);
valueFiles.forEach(f => args.push(`--values=${f}`));
args.push("--values=./values.yml");

Expand Down

0 comments on commit d494b05

Please sign in to comment.