diff --git a/core/src/plugins/exec/config.ts b/core/src/plugins/exec/config.ts index 1e1341ab78..c76c81d7d2 100644 --- a/core/src/plugins/exec/config.ts +++ b/core/src/plugins/exec/config.ts @@ -22,6 +22,7 @@ import { } from "../../config/common" import { ArtifactSpec } from "../../config/validation" import { dedent } from "../../util/string" +import { DEFAULT_RUN_TIMEOUT_SEC } from "../../constants" const execPathDoc = dedent` Note that if a Build is referenced in the \`build\` field, the command will be run from the build directory for that Build action. If that Build has \`buildAtSource: true\` set, the command will be run from the source directory of the Build action. If no \`build\` reference is set, the command is run from the source directory of this action. @@ -53,6 +54,7 @@ const execCommonSchema = createSchema({ `), }), }) + // BUILD // export interface ExecBuildActionSpec extends CommonKeys { @@ -60,6 +62,7 @@ export interface ExecBuildActionSpec extends CommonKeys { timeout?: number env: StringMap } + export type ExecBuildConfig = BuildActionConfig<"exec", ExecBuildActionSpec> export type ExecBuild = BuildAction @@ -97,7 +100,7 @@ export interface ExecDeployActionSpec extends CommonKeys { cleanupCommand?: string[] deployCommand: string[] statusCommand?: string[] - timeout?: number + timeout: number statusTimeout: number env: StringMap } @@ -159,8 +162,7 @@ export const execDeployActionSchema = createSchema({ ${execPathDoc} ` ), - // TODO-0.13.0: Set a default in v0.13.0. - timeout: joi.number().description(dedent` + timeout: joi.number().integer().min(1).default(DEFAULT_RUN_TIMEOUT_SEC).description(dedent` The maximum duration (in seconds) to wait for \`deployCommand\` to exit. Ignored if \`persistent: false\`. `), statusTimeout: joi.number().default(defaultStatusTimeout).description(dedent` @@ -204,6 +206,7 @@ export const execRunActionSchema = createSchema({ // TEST // export interface ExecTestActionSpec extends ExecRunActionSpec {} + export type ExecTestConfig = TestActionConfig<"exec", ExecTestActionSpec> export type ExecTest = TestAction diff --git a/docs/reference/action-types/Deploy/exec.md b/docs/reference/action-types/Deploy/exec.md index a51ebc0e1e..70003836ba 100644 --- a/docs/reference/action-types/Deploy/exec.md +++ b/docs/reference/action-types/Deploy/exec.md @@ -202,7 +202,7 @@ spec: cleanupCommand: # The maximum duration (in seconds) to wait for `deployCommand` to exit. Ignored if `persistent: false`. - timeout: + timeout: 600 # The maximum duration (in seconds) to wait for a for the `statusCommand` to return a zero exit code. Ignored if no # `statusCommand` is set. @@ -515,9 +515,9 @@ Note that if a Build is referenced in the `build` field, the command will be run The maximum duration (in seconds) to wait for `deployCommand` to exit. Ignored if `persistent: false`. -| Type | Required | -| -------- | -------- | -| `number` | No | +| Type | Default | Required | +| -------- | ------- | -------- | +| `number` | `600` | No | ### `spec.statusTimeout`