Skip to content

Class.Resource

DecentM edited this page Jan 16, 2026 · 86 revisions

@decentm/concourse-ts / Resource

Class: Resource<Source, PutParams, GetParams, ResourceTypeType, ResourceTypeConfig>

Defined in: components/resource.ts:32

A resource is an external entity that can be checked, fetched (get), and pushed (put). Resources are versioned and can trigger jobs when new versions are detected.

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

Type Parameters

Source extends Config = Config

PutParams extends Config = Config

GetParams extends Config = Config

ResourceTypeType extends string = string

ResourceTypeConfig extends Config = Config

Constructors

new Resource()

new Resource<Source, PutParams, GetParams, ResourceTypeType, ResourceTypeConfig>(name, type, customise?): Resource<Source, PutParams, GetParams, ResourceTypeType, ResourceTypeConfig>

Defined in: components/resource.ts:148

Parameters

name

string

type

ResourceType<ResourceTypeType, ResourceTypeConfig>

customise?

(instance) => void

Returns

Resource<Source, PutParams, GetParams, ResourceTypeType, ResourceTypeConfig>

Methods

add_tags()

add_tags(...tags): void

Defined in: components/resource.ts:249

Adds tags to specify which workers should run the resource's check, get, and put operations.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

tags

...string[]

Worker tags

Returns

void


as_get_step()

as_get_step(input?, customise?): GetStep<Source, PutParams, GetParams>

Defined in: components/resource.ts:332

Creates a GetStep for fetching this resource. The step can be added to a job's plan.

https://concourse-ci.org/docs/steps/get/

Parameters

input?

AsGetStepInput<GetParams>

Optional params, passed jobs, and trigger flag

customise?

(instance) => void

Optional customiser for the created step

Returns

GetStep<Source, PutParams, GetParams>

A configured GetStep for this resource


as_put_step()

as_put_step(input?, customise?): PutStep<Source, PutParams, GetParams>

Defined in: components/resource.ts:293

Creates a PutStep for pushing to this resource. The step can be added to a job's plan.

https://concourse-ci.org/docs/steps/put/

Parameters

input?

AsPutStepInput<PutParams>

Optional params and inputs for the put

customise?

(instance) => void

Optional customiser for the created step

Returns

PutStep<Source, PutParams, GetParams>

A configured PutStep for this resource


customise_get_step()

customise_get_step(init): void

Defined in: components/resource.ts:106

Customises GetSteps created from this specific Resource instance's as_get_step method.

Type.Customiser

Parameters

init

(instance, parent) => void

Customiser function receiving the GetStep and this Resource

Returns

void


customise_put_step()

customise_put_step(init): void

Defined in: components/resource.ts:125

Customises PutSteps created from this specific Resource instance's as_put_step method.

Type.Customiser

Parameters

init

(instance, parent) => void

Customiser function receiving the PutStep and this Resource

Returns

void


set_check_every()

set_check_every(input): void

Defined in: components/resource.ts:201

Sets how frequently to check for new versions of the resource. Use 'never' to disable automatic checking.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

input

Duration between checks

DurationInput | "never"

Returns

void


set_icon()

set_icon(icon): void

Defined in: components/resource.ts:215

Sets the Material Design icon to display for this resource in the UI. See https://pictogrammers.com/library/mdi/ for available icons.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

icon

string

The icon name (e.g., 'git', 'docker')

Returns

void


set_name()

set_name(name): void

Defined in: components/resource.ts:144

Sets the name of the resource. The name is used to reference the resource in jobs and steps.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

name

string

The resource name

Returns

void


set_old_name()

set_old_name(old_name): void

Defined in: components/resource.ts:224

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

old_name

string

Returns

void


set_public()

set_public(): void

Defined in: components/resource.ts:235

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

https://concourse-ci.org/docs/resources/#resource-schema

Returns

void


set_source()

set_source(source): void

Defined in: components/resource.ts:187

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

source

Source

Returns

void


set_version()

set_version(version): void

Defined in: components/resource.ts:265

Pins the resource to a specific version. When set, only this version will be used unless explicitly unpinned.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

version

Version

The version to pin to

Returns

void


set_webhook_token()

set_webhook_token(webhook_token): void

Defined in: components/resource.ts:279

Sets a token for webhook-triggered checking. When set, external systems can notify Concourse of new versions via webhook.

https://concourse-ci.org/docs/resources/#resource-schema

Parameters

webhook_token

string

The webhook token

Returns

void


customise()

static customise(init): void

Defined in: components/resource.ts:48

Customises all Resources constructed after calling this function.

Type.Customiser

Parameters

init

(instance) => void

Returns

void


customise_get_step()

static customise_get_step<Source, PutParams, GetParams>(init): void

Defined in: components/resource.ts:61

Customises all GetSteps created from any Resource's as_get_step method.

Type.Customiser

Type Parameters

Source extends Config = Config

PutParams extends Config = Config

GetParams extends Config = Config

Parameters

init

(instance, parent) => void

Customiser function receiving the GetStep and the Resource it was created from

Returns

void


customise_put_step()

static customise_put_step<Source, PutParams, GetParams>(init): void

Defined in: components/resource.ts:83

Customises all PutSteps created from any Resource's as_put_step method.

Type.Customiser

Type Parameters

Source extends Config = Config

PutParams extends Config = Config

GetParams extends Config = Config

Parameters

init

(instance, parent) => void

Customiser function receiving the PutStep and the Resource it was created from

Returns

void

Clone this wiki locally