Skip to content

Class.Job

DecentM edited this page Aug 26, 2024 · 57 revisions

@decentm/concourse-ts / Job

Class: Job

https://concourse-ci.org/jobs.html

Constructors

new Job()

new Job(name, customise?): Job

Constructs a new Job

https://concourse-ci.org/jobs.html

Parameters

name: string

The name of the step. This will be visible in the Concourse UI.

customise?

Returns

Job

Source

components/job.ts:34

Properties

build_log_retention?

optional build_log_retention: BuildLogRetentionPolicy

https://concourse-ci.org/jobs.html#schema.job.build_log_retention

Source

components/job.ts:74


disable_manual_trigger?

optional disable_manual_trigger: boolean

https://concourse-ci.org/jobs.html#schema.job.disable_manual_trigger

Source

components/job.ts:79


interruptible?

optional interruptible: boolean

https://concourse-ci.org/jobs.html#schema.job.interruptible

Source

components/job.ts:84


max_in_flight?

optional max_in_flight: number

https://concourse-ci.org/jobs.html#schema.job.max_in_flight

Source

components/job.ts:89


name

name: string

The name of the step. This will be visible in the Concourse UI.

Source

components/job.ts:35


old_name?

optional old_name: string

https://concourse-ci.org/jobs.html#schema.job.old_name

Source

components/job.ts:94


public

public: boolean

https://concourse-ci.org/jobs.html#schema.job.public

Source

components/job.ts:225


serial

serial: boolean

https://concourse-ci.org/jobs.html#schema.job.serial

Source

components/job.ts:230

Methods

add_ensure()

add_ensure(step): void

Adds a step that will get executed all of the time, regardless of the exit status of previous steps. Useful for cleaning up state for example.

The real step added to this Job will always be a DoStep, with the passed step added onto it as the last Step.

https://concourse-ci.org/jobs.html#schema.job.ensure

Parameters

step: AnyStep

The Step to execute when this job finishes.

Returns

void

Source

components/job.ts:211


add_on_abort()

add_on_abort(step): void

Adds a step that will get executed if the job is aborted. Abort indicates that a user has manually cancelled the job (including API clients).

The real step added to this Job will always be a DoStep, with the passed step added onto it as the last Step.

https://concourse-ci.org/jobs.html#schema.job.on_abort

Parameters

step: AnyStep

The Step to execute when this job is aborted.

Returns

void

Source

components/job.ts:186


add_on_error()

add_on_error(step): void

Adds a step that will get executed if any previous step fails. Error indicates a normal exit state, such as tests failing, or compilers crashing.

The real step added to this Job will always be a DoStep, with the passed step added onto it as the last Step.

https://concourse-ci.org/jobs.html#schema.job.on_error

Parameters

step: AnyStep

The Step to execute when this job errors.

Returns

void

Source

components/job.ts:160


add_on_failure()

add_on_failure(step): void

Adds a step that will get executed if any previous step fails. Failure indicates a non-normal exit state, such as the worker crashing, or losing connection.

The real step added to this Job will always be a DoStep, with the passed step added onto it as the last Step.

https://concourse-ci.org/jobs.html#schema.job.on_failure

Parameters

step: AnyStep

The Step to execute when this job fails.

Returns

void

Source

components/job.ts:134


add_on_success()

add_on_success(step): void

Adds a step that will get executed if all previous steps succeed. The real step added to this Job will always be a DoStep, with the passed step added onto it as the last Step.

https://concourse-ci.org/jobs.html#schema.job.on_success

Parameters

step: AnyStep

The Step to execute when this job succeeds.

Returns

void

Source

components/job.ts:108


add_serial_group()

add_serial_group(serial_group): void

https://concourse-ci.org/jobs.html#schema.job.serial_groups

Parameters

serial_group: string

Returns

void

Source

components/job.ts:239


add_step()

add_step(...steps): void

Adds one or more steps to the Job. They will be executed in the same order as they are passed.

Parameters

• ...steps: AnyStep[]

Steps to add to the Job in order.

Returns

void

Source

components/job.ts:55


add_step_first()

add_step_first(...steps): void

Adds one or more steps before the current ones to the Job. They will be executed in the same order they're passed, but before other steps that exist on this Job.

Parameters

• ...steps: AnyStep[]

Returns

void

Source

components/job.ts:67


serialise()

serialise(): Job

Serialises this Job into a valid Concourse configuration fixture. The returned value needs to be converted into YAML to be used in Concourse.

Returns

Job

A JSON representation of this Job

Source

components/job.ts:324


customise()

static customise(init): void

Sets a customiser function onto all jobs created after this call. If a customiser already exists, it will be overwritten.

Parameters

init

Your customiser function. It receives a Job instance whenever a Job is constructed.

Returns

void

Source

components/job.ts:22

Clone this wiki locally