@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
749 lines (748 loc) • 19.8 kB
TypeScript
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Query rules to target specific agents in k=v format
*/
export type AgentsList = string[];
/**
* Array of notification options for this step
*/
export type BuildNotify = (("github_check" | "github_commit_status") | {
email?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
basecamp_campfire?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
slack?: string | {
channels?: string[];
message?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
webhook?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
pagerduty_change_event?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
github_commit_status?: {
/**
* GitHub commit status name
*/
context?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
github_check?: {
/**
* GitHub commit status name
*/
context?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
})[];
/**
* A list of input fields required to be filled out before unblocking the step
*/
export type Fields = ({
/**
* The text input name
*/
text?: string;
/**
* The meta-data key that stores the field's input
*/
key: string;
/**
* The explanatory text that is shown after the label
*/
hint?: string;
/**
* Whether the field is required for form submission
*/
required?: boolean;
/**
* The value that is pre-filled in the text field
*/
default?: string;
} | {
/**
* The text input name
*/
select?: string;
/**
* The meta-data key that stores the field's input
*/
key: string;
/**
* The value of the option(s) that will be pre-selected in the dropdown
*/
default?: string | string[];
/**
* The explanatory text that is shown after the label
*/
hint?: string;
/**
* Whether more than one option may be selected
*/
multiple?: boolean;
options: {
/**
* The text displayed on the select list item
*/
label: string;
/**
* The value to be stored as meta-data
*/
value: string;
/**
* The text displayed directly under the select field’s label
*/
hint?: string;
/**
* Whether the field is required for form submission
*/
required?: boolean;
}[];
/**
* Whether the field is required for form submission
*/
required?: boolean;
})[];
/**
* Pauses the execution of a build and waits on a user to unblock it
*/
export type StringBlockStep = "block";
/**
* Pauses the execution of a build and waits on a user to unblock it
*/
export type StringInputStep = "input";
/**
* Waits for previous steps to pass before continuing
*/
export type StringWaitStep = "wait" | "waiter";
export interface JSONSchemaForBuildkitePipelineConfigurationFiles {
env?: Env;
agents?: AgentsObject | AgentsList;
notify?: BuildNotify;
/**
* A list of steps
*/
steps?: (BlockStep | NestedBlockStep | StringBlockStep | InputStep | NestedInputStep | StringInputStep | CommandStep | NestedCommandStep | StringWaitStep | WaitStep | NestedWaitStep | TriggerStep | NestedTriggerStep | GroupStep)[];
[]: unknown;
}
/**
* Environment variables for this step
*/
export interface Env {
[]: unknown;
}
/**
* Query rules to target specific agents
*/
export interface AgentsObject {
[]: unknown;
}
export interface BlockStep {
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* The label of the block step
*/
block?: string;
/**
* The state that the build is set to when the build is blocked by this block step
*/
blocked_state?: "passed" | "failed" | "running";
/**
* Which branches will include this step in their builds
*/
branches?: string | string[];
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
fields?: Fields;
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
label?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
name?: string;
/**
* The instructional message displayed in the dialog box when the unblock step is activated
*/
prompt?: string;
type?: "block";
}
export interface NestedBlockStep {
block?: BlockStep;
}
export interface InputStep {
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* The label of the input step
*/
input?: string;
/**
* Which branches will include this step in their builds
*/
branches?: string | string[];
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
fields?: Fields;
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
label?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
name?: string;
/**
* The instructional message displayed in the dialog box when the unblock step is activated
*/
prompt?: string;
type?: "input";
}
export interface NestedInputStep {
input?: InputStep;
}
export interface CommandStep {
agents?: AgentsObject | AgentsList;
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* The glob path/s of artifacts to upload once this step has finished running
*/
artifact_paths?: string | string[];
/**
* Which branches will include this step in their builds
*/
branches?: string | string[];
/**
* Whether to cancel the job as soon as the build is marked as failing
*/
cancel_on_build_failing?: boolean;
/**
* The commands to run on the agent
*/
command?: string[] | string;
/**
* The commands to run on the agent
*/
commands?: string[] | string;
/**
* The maximum number of jobs created from this step that are allowed to run at the same time. If you use this attribute, you must also define concurrency_group.
*/
concurrency?: number;
/**
* A unique name for the concurrency group that you are creating with the concurrency attribute
*/
concurrency_group?: string;
/**
* Control command order, allowed values are 'ordered' (default) and 'eager'. If you use this attribute, you must also define concurrency_group and concurrency.
*/
concurrency_method?: "ordered" | "eager";
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
env?: Env;
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
label?: string;
matrix?: (string | number | boolean)[] | {
setup: (string | number | boolean)[] | {
/**
* List of elements for this Build Matrix dimension
*/
[]: (string | number | boolean)[];
};
/**
* List of Build Matrix adjustments
*/
adjustments?: {
with: (string | number | boolean)[] | {
/**
* Build Matrix dimension element
*/
[]: string;
};
/**
* Whether this step should be skipped. You can specify a reason for using a string.
*/
skip?: boolean | string;
/**
* The conditions for marking the step as a soft-fail.
*/
soft_fail?: boolean | {
/**
* The exit status number that will cause this job to soft-fail
*/
exit_status?: "*" | number;
[]: unknown;
}[];
[]: unknown;
}[];
[]: unknown;
};
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
name?: string;
/**
* Array of notification options for this step
*/
notify?: (("github_check" | "github_commit_status") | {
basecamp_campfire?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
slack?: string | {
channels?: string[];
message?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
github_commit_status?: {
/**
* GitHub commit status name
*/
context?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
} | {
github_check?: {
/**
* GitHub commit status name
*/
context?: string;
[]: unknown;
};
/**
* A boolean expression that omits the step when false
*/
if?: string;
})[];
/**
* The number of parallel jobs that will be created based on this step
*/
parallelism?: number;
plugins?: (string | {
[]: unknown;
})[] | {
[]: unknown;
};
/**
* The conditions for marking the step as a soft-fail.
*/
soft_fail?: boolean | {
/**
* The exit status number that will cause this job to soft-fail
*/
exit_status?: "*" | number;
[]: unknown;
}[];
/**
* The conditions for retrying this step.
*/
retry?: {
/**
* Whether to allow a job to retry automatically. If set to true, the retry conditions are set to the default value.
*/
automatic?: boolean | AutomaticRetry | AutomaticRetry[];
/**
* Whether to allow a job to be retried manually
*/
manual?: boolean | {
/**
* Whether or not this job can be retried manually
*/
allowed?: boolean;
/**
* Whether or not this job can be retried after it has passed
*/
permit_on_passed?: boolean;
/**
* A string that will be displayed in a tooltip on the Retry button in Buildkite. This will only be displayed if the allowed attribute is set to false.
*/
reason?: string;
};
[]: unknown;
};
/**
* Whether this step should be skipped. You can specify a reason for using a string.
*/
skip?: boolean | string;
/**
* The number of minutes to time out a job
*/
timeout_in_minutes?: number;
type?: "script" | "command" | "commands";
/**
* Priority of the job, higher priorities are assigned to agents
*/
priority?: number;
}
export interface AutomaticRetry {
/**
* The exit status number that will cause this job to retry
*/
exit_status?: "*" | number;
/**
* The number of times this job can be retried
*/
limit?: number;
/**
* The exit signal, if any, that may be retried
*/
signal?: string;
/**
* The exit signal reason, if any, that may be retried
*/
signal_reason?: "*" | "none" | "agent_refused" | "agent_stop" | "cancel" | "process_run_error";
}
export interface NestedCommandStep {
command?: CommandStep;
commands?: CommandStep;
script?: CommandStep;
}
export interface WaitStep {
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* Continue to the next steps, even if the previous group of steps fail
*/
continue_on_failure?: boolean;
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
type?: "wait" | "waiter";
/**
* Waits for previous steps to pass before continuing
*/
wait?: null | "";
waiter?: null | "";
}
export interface NestedWaitStep {
wait?: WaitStep1;
waiter?: WaitStep;
}
/**
* Waits for previous steps to pass before continuing
*/
export interface WaitStep1 {
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* Continue to the next steps, even if the previous group of steps fail
*/
continue_on_failure?: boolean;
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
type?: "wait" | "waiter";
/**
* Waits for previous steps to pass before continuing
*/
wait?: null | "";
waiter?: null | "";
}
export interface TriggerStep {
/**
* Whether to proceed with this step and further steps if a step named in the depends_on attribute fails
*/
allow_dependency_failure?: boolean;
/**
* Whether to continue the build without waiting for the triggered step to complete
*/
async?: boolean;
/**
* Which branches will include this step in their builds
*/
branches?: string | string[];
/**
* Properties of the build that will be created when the step is triggered
*/
build?: {
/**
* The branch for the build
*/
branch?: string;
/**
* The commit hash for the build
*/
commit?: string;
env?: Env;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
label?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
name?: string;
/**
* The message for the build (supports emoji)
*/
message?: string;
/**
* Meta-data for the build
*/
meta_data?: {
[]: unknown;
};
/**
* The slug of the pipeline to create a build
*/
trigger?: string;
type?: "trigger";
};
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
label?: string;
/**
* The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
*/
name?: string;
type?: "trigger";
/**
* The slug of the pipeline to create a build
*/
trigger?: string;
/**
* Whether this step should be skipped. You can specify a reason for using a string.
*/
skip?: boolean | string;
/**
* The conditions for marking the step as a soft-fail.
*/
soft_fail?: boolean | {
/**
* The exit status number that will cause this job to soft-fail
*/
exit_status?: "*" | number;
[]: unknown;
}[];
}
export interface NestedTriggerStep {
trigger?: TriggerStep;
}
export interface GroupStep {
/**
* The step keys for a step to depend on
*/
depends_on?: null | string | (string | {
step?: string;
allow_failure?: boolean;
})[];
/**
* The name to give to this group of steps
*/
group?: string;
/**
* A string identifier
*/
id?: string;
/**
* A string identifier
*/
identifier?: string;
/**
* A boolean expression that omits the step when false
*/
if?: string;
/**
* A unique identifier for a step, must not resemble a UUID
*/
key?: string;
/**
* The name to give to this group of steps
*/
label?: string;
/**
* The name to give to this group of steps
*/
name?: string;
/**
* A list of steps
*/
steps?: (StringBlockStep | BlockStep | CommandStep | NestedCommandStep | TriggerStep | NestedTriggerStep | StringInputStep | InputStep | NestedInputStep | StringWaitStep | WaitStep | NestedWaitStep)[];
type?: "group";
}