Skip to content

Execute Concourse resources ΒΆ

Forge can be used to run, test and debug Concourse resources (e.g. concourse/git-resource) or to utilize them within other CI systems.

Forge is specifically focused on running individual Concourse resources (e.g. concourse/git-resource), not entire Concourse pipelines. For example, Forge is not intended to run a pipeline such as:

# pipeline.yml
resources:
  - name: forge-git
    type: git
    source:
      uri: https://github.com/frantjc/forge
jobs:
  - name: example
    plan:
      - get: forge-git
        trigger: true

Rather, it is intended to run a single resource from within a pipeline, like so:

forge get forge-git --config pipeline.yml

Forge mounts the current working directory to the resource's. So, after the previous command is ran, if it succeeds, the working directory should have frantjc/forge cloned into it.

Forge can also execute a Concourse resource's check and put commands by simply replacing the get in the above command, as seen below:

forge check forge-git --config pipeline.yml

When executing Concourse resources, Forge will source resource_types and resources from the working directory's .forge.yml (overridable with --config as seen previously). This schema is conveniently compatible with Concourse's pipeline schema.

Just like Concourse itself, Forge ships with some resource types builtin which can also be overridden. This is why the git resource type did not need explicitly defined in the above examples.

You can also attach to the container executing the resource to snoop around:

forge get --attach forge-git

The resource's image must have bash or sh on its PATH for the attach to work.