Skip to content

Class.Job

DecentM edited this page Jan 16, 2026 · 86 revisions

@decentm/concourse-ts / Job

Class: Job

Defined in: components/job.ts:12

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

Constructors

new Job()

new Job(name, customise?): Job

Defined in: components/job.ts:34

Constructs a new Job

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

Parameters

name

string

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

customise?

(instance) => void

Returns

Job

Properties

name

name: string

Defined in: components/job.ts:35

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

Methods

add_ensure()

add_ensure(step): void

Defined in: components/job.ts:237

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/docs/jobs/#job-schema

Parameters

step

AnyStep

The Step to execute when this job finishes.

Returns

void


add_on_abort()

add_on_abort(step): void

Defined in: components/job.ts:212

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/docs/jobs/#job-schema

Parameters

step

AnyStep

The Step to execute when this job is aborted.

Returns

void


add_on_error()

add_on_error(step): void

Defined in: components/job.ts:186

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/docs/jobs/#job-schema

Parameters

step

AnyStep

The Step to execute when this job errors.

Returns

void


add_on_failure()

add_on_failure(step): void

Defined in: components/job.ts:160

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/docs/jobs/#job-schema

Parameters

step

AnyStep

The Step to execute when this job fails.

Returns

void


add_on_success()

add_on_success(step): void

Defined in: components/job.ts:134

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/docs/jobs/#job-schema

Parameters

step

AnyStep

The Step to execute when this job succeeds.

Returns

void


add_serial_group()

add_serial_group(serial_group): void

Defined in: components/job.ts:277

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

Parameters

serial_group

string

Returns

void


add_steps()

add_steps(...steps): void

Defined in: components/job.ts:55

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


add_steps_first()

add_steps_first(...steps): void

Defined in: components/job.ts:67

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


serialise()

serialise(): Job

Defined in: components/job.ts:358

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


set_build_log_retention()

set_build_log_retention(build_log_retention): void

Defined in: components/job.ts:76

https://concourse-ci.org/docs/jobs/#build_log_retention_policy-schema

Parameters

build_log_retention

BuildLogRetentionPolicy

Returns

void


set_disable_manual_trigger()

set_disable_manual_trigger(): void

Defined in: components/job.ts:89

Sets "disable_manual_trigger" to true - avoid calling to keep false

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

Returns

void


set_interruptible()

set_interruptible(): void

Defined in: components/job.ts:100

Sets "interruptible" to true - avoid calling to keep false

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

Returns

void


set_max_in_flight()

set_max_in_flight(max_in_flight): void

Defined in: components/job.ts:109

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

Parameters

max_in_flight

number

Returns

void


set_old_name()

set_old_name(old_name): void

Defined in: components/job.ts:118

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

Parameters

old_name

string

Returns

void


set_public()

set_public(): void

Defined in: components/job.ts:255

Sets "public" to true - avoid calling to keep false

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

Returns

void


set_serial()

set_serial(): void

Defined in: components/job.ts:266

Sets "serial" to true - avoid calling to keep false

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

Returns

void


customise()

static customise(init): void

Defined in: components/job.ts:22

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

Parameters

init

(instance) => void

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

Returns

void

Clone this wiki locally