concourse/concourse-pipeline-resource

Name: concourse-pipeline-resource

Owner: Concourse

Description: Concourse resource for interacting with concourse pipelines

Created: 2016-03-05 07:03:17.0

Updated: 2018-05-23 20:38:58.0

Pushed: 2018-05-23 20:38:56.0

Homepage: null

Size: 7995

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Concourse Pipeline Resource

Get and set concourse pipelines from concourse.

Installing

Use this resource by adding the following to the resource_types section of a pipeline config:


urce_types:
me: concourse-pipeline
pe: docker-image
urce:
repository: concourse/concourse-pipeline-resource

See concourse docs for more details on adding resource_types to a pipeline config.

Source configuration

Check returns the versions of all pipelines. Configure as follows:


urces:
me: my-pipelines
pe: concourse-pipeline
urce:
target: https://my-concourse.com
insecure: "false"
teams:
- name: team-1
  username: some-user
  password: some-password
- name: team-2
  username: other-user
  password: other-password
in: Get the configuration of the pipelines

Get the config for each pipeline; write it to the local working directory (e.g. /tmp/build/get) with the filename derived from the pipeline name and team name.

For example, if there are two pipelines foo and bar belonging to team-1 and team-2 respectively, the config for the first will be written to team-1-foo.yml and the second to team-2-bar.yml.


urces:
me: my-pipelines
pe: concourse-pipeline
urce: ...

:
me: download-my-pipelines
an:
get: my-pipelines
out: Set the configuration of the pipelines

Set the configuration for each pipeline provided in the params section.

Configuration can be either static or dynamic. Static configuration has the configuration fixed in the pipeline config file, whereas dynamic configuration reads the pipeline configuration from the provided file.

One of either static or dynamic configuration must be provided; using both is not allowed.

static

urces:
me: my-pipelines
pe: concourse-pipeline
urce:
teams:
- name: team-1

:
me: set-my-pipelines
an:
put: my-pipelines
params:
  pipelines:
  - name: my-pipeline
    team: team-1
    config_file: path/to/config/file
    vars_files:
    - path/to/optional/vars/file/1
    - path/to/optional/vars/file/2
dynamic

Resource configuration as above for Check, with the following job configuration:


:
me: set-my-pipelines
an:
put: my-pipelines
params:
  pipelines_file: path/to/pipelines/file
Developing
Prerequisites
Dependencies

Dependencies are vendored in the vendor directory, according to the golang 1.5 vendor experiment.

Updating dependencies

Install gvt and make sure it is available in your $PATH, e.g.:

et -u github.com/FiloSottile/gvt

To add a new dependency:

fetch

To update an existing dependency to a specific version:

delete <import_path>
fetch -revision <revision_number> <import_path>
Running the tests

Install the ginkgo executable with:

et -u github.com/onsi/ginkgo/ginkgo

The tests require a running Concourse configured with basic auth to test against.

Run the tests with the following command (optionally also setting INSECURE=true):

LOCATION=path/to/fly \
ET=https://my-concourse.com \
NAME=my-basic-auth-user \
WORD=my-basic-auth-password \
n/test

or with the Dockerfile

The tests have been embedded with the Dockerfile; ensuring that the testing environment is consistent across any docker enabled platform. When the docker image builds, the test are run inside the docker container, on failure they will stop the build.

Run the tests with the following command:

er build -t concourse-pipeline-resource .
Contributing

Please ensure the tests pass locally.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.