1.9 Resource Types
Each resource in a pipeline has a type
. The resource's type determines what versions are detected, the bits that are fetched when the resource's get
step runs, and the side effect that occurs when the resource's put
step runs.
Concourse comes with a few "core" resource types to cover common use cases like git
and s3
- the rest are developed and supported by the Concourse community. An exhaustive list of all resource types is available in the Resource Types catalog.
A pipeline's resource types are listed under
with the following schema:
resource_type
schema
The name of the resource type. This should be short and simple. This name will be referenced by
defined within the same pipeline, and
s used by tasks running in the pipeline.
Pipeline-provided resource types can override the core resource types by specifying the same name.
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.
The configuration for the resource type's resource. This varies by resource type, and is a black box to Concourse; it is blindly passed to the resource at runtime.
To use registry-image
as an example, the source would contain something like repository: username/reponame
. See the Registry Image resource (or whatever resource type your resource type uses) for more information.
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.
Arbitrary config to pass when running the get
to fetch the resource type's image.
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.
Default []
. A list of tags to determine which workers the checks will be performed on. You'll want to specify this if the source is internal to a worker's network, for example. See also
.
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)
and passed to the resource at runtime.
resource_types:
- name: gcs
type: registry-image
source:
repository: frodenas/gcs-resource
defaults:
json_key: ((default_key))
resources:
- name: bucket-a
type: gcs
source:
bucket: a
- name: bucket-b
type: gcs
source:
bucket: b
- name: bucket-c
type: gcs
source:
bucket: c
json_key: ((different_key))
Since it's possible to overwrite the base resource types, it can be used to give defaults to resources at the pipeline level.
resource_types:
- name: registry-image
type: registry-image
source:
repository: concourse/registry-image-resource
defaults:
registry_mirror:
host: https://registry.mirror.example.com
resources:
- name: mirrored-image
type: registry-image
source:
repository: busybox
Alternatively, the web node can be configured to use defaults for base resource types
Resource Types can be used to extend the functionality of your pipeline and provide deeper integrations. This example uses one to trigger a job whenever a new Dinosaur Comic is out.
---
resource_types:
- name: rss
type: registry-image
source:
repository: suhlig/concourse-rss-resource
tag: latest
resources:
- name: booklit-releases
type: rss
source:
url: http://www.qwantz.com/rssfeed.php
jobs:
- name: announce
plan:
- get: booklit-releases
trigger: true
-
1.9.1
Implementing a Resource Type
-
1.9.1.1
check
: Check for new versions. -
1.9.1.2
in
: Fetch a given resource. -
1.9.1.3
out
: Update a resource. - 1.9.1.4 Metadata
- 1.9.1.5 Certificate Propagation
- 1.9.1.6 Testing resources locally using docker
-
1.9.1.1
-
1.9.2
Managing Resource Types
-
1.9.2.1
fly check-resource-type
-
1.9.2.1