Class.ResourceType - DecentM/concourse-ts GitHub Wiki

@decentm/concourse-ts / ResourceType

Class: ResourceType<Type, Source>

Defined in: components/resource-type.ts:10

Type Parameters

Type extends string = string

Source extends Config = Config

Constructors

new ResourceType()

new ResourceType<Type, Source>(name, customise?): ResourceType<Type, Source>

Defined in: components/resource-type.ts:45

Parameters

name

string

customise?

(instance) => void

Returns

ResourceType<Type, Source>

Properties

name

name: string

Defined in: components/resource-type.ts:43

The name of the resource type. This should be short and simple. This name will be referenced by pipeline.resources defined within the same pipeline, and task-config.image_resources used by tasks running in the pipeline.

Pipeline-provided resource types can override the core resource types by specifying the same name.

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

Methods

add_tags()

add_tags(...tags): void

Defined in: components/resource-type.ts:219

Adds one or more tags to this resource type.

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

Parameters

tags

...string[]

Returns

void


create_resource()

create_resource<Source, PutParams, GetParams>(name, customise?): Resource<Source, PutParams, GetParams>

Defined in: components/resource-type.ts:66

Creates a new resource preconfigured with this resource type.

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

Type Parameters

Source extends Config = Config

PutParams extends Config = Config

GetParams extends Config = Config

Parameters

name

string

customise?

(instance) => void

Returns

Resource<Source, PutParams, GetParams>


customise_resource()

customise_resource<Source, PutParams, GetParams>(customiser): void

Defined in: components/resource-type.ts:22

Type Parameters

Source extends Config = Config

PutParams extends Config = Config

GetParams extends Config = Config

Parameters

customiser

(instance) => void

Returns

void


serialise()

serialise(): ResourceType

Defined in: components/resource-type.ts:231

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

Returns

ResourceType


set_check_every()

set_check_every(input): void

Defined in: components/resource-type.ts:139

Default 1m. The interval on which to check for new versions of the resource type. Acceptable interval options are defined by the time.ParseDuration function.

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

Parameters

input

DurationInput | "never"

Returns

void


set_defaults()

set_defaults(defaults): void

Defined in: components/resource-type.ts:158

The default configuration for the resource type. This varies by resource type, and is a black box to Concourse; it is merged with (duplicate fields are overwritten by) resource.source and passed to the resource at runtime.

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

Parameters

defaults

Config

Returns

void


set_params()

set_params(params): void

Defined in: components/resource-type.ts:177

Arbitrary config to pass when running the get to fetch the resource type's image.

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

Parameters

params

Config

Returns

void


set_privileged()

set_privileged(): void

Defined in: components/resource-type.ts:206

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

Default false. If set to true, the resource's containers will be run with full capabilities, as determined by the worker backend the task runs on.

For Linux-based backends it typically determines whether or not the container will run in a separate user namespace, and whether the root user is "actual" root (if set to true) or a user namespaced root (if set to false, the default).

This is a gaping security hole; only configure it if the resource type needs it (which should be called out in its documentation). This is not up to the resource type to decide dynamically, so as to prevent privilege escalation via third-party resource type exploits.

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

Returns

void


set_source()

set_source(source): void

Defined in: components/resource-type.ts:124

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

Parameters

source

Source

Returns

void


set_type()

set_type(input): void

Defined in: components/resource-type.ts:104

The type of the resource used to provide the resource type's container image.

This is a bit meta. Usually this value will be registry-image as the resource type must result in a container image.

A resource type's type can refer to other resource types, and can also use the core type that it's overriding. This is useful for bringing in a newer or forked registry-image resource.

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

Parameters

input

Type | ResourceType<string, Config>

Returns

void


customise()

static customise(init): void

Defined in: components/resource-type.ts:16

Parameters

init

(instance) => void

Returns

void