<commit_before># Concourse Pipeline Resource

Interact with concourse pipelines from concourse.

## Installing

This resource is only compatible with Concourse versions 0.74.0 and higher
as no BOSH release is provided. Use this resource by adding the following to
the `resource_types` section of a pipeline config:

```yaml
resource_types:
- name: concourse-pipeline
  type: docker-image
  source:
    repository: robdimsdale/concourse-pipeline-resource
    tag: v0.6.3
```

The value for `tag` should be the latest tag in this repository.

The docker image is `robdimsdale/concourse-pipeline-resource`; the images are
available on
[dockerhub](https://hub.docker.com/r/robdimsdale/concourse-pipeline-resource).

The rootfs of the docker image is available with each release on the
[releases page](https://github.com/robdimsdale/concourse-pipeline-resource/releases).

The docker image is semantically versioned; these versions correspond to the git tags
in this repository.

## Source Configuration

* `target`: *Required.*  URL of your concourse instance e.g. `https://my-concourse.com`.

* `username`: *Required.*  Basic auth username for logging in to Concourse.
  Basic Auth must be enabled on the Concourse installation.

* `password`: *Required.*  Basic auth password for logging in to Concourse.
  Basic Auth must be enabled on the Concourse installation.

### Example Pipeline Configuration

#### Check

``` yaml
---
resources:
- name: my-pipelines
  type: concourse-pipeline
  source:
    target: https://my-concourse.com
    username: some-user
    password: <PASSWORD>
```

#### In

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

```yaml
---
jobs:
- name: download-my-pipelines
  plan:
  - get: my-pipelines
```

#### Out

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

```yaml
---
jobs:
- name: set-my-pipelines
  plan:
  - put: my-pipelines
    params:
      pipelines:
      - config_file: path/to/config/file
        vars_files:
        - path/to/optional/vars/file/1
        - path/to/optional/vars/file/2
```

## Behavior

### `check`: Check for changes to the pipelines.

Return a checksum of the concatenated contents of all pipelines.

### `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.

For example, if there are two pipelines `foo` and `bar` the config for the
first will be written to `foo.yml` and the second to `bar.yml`.

### `out`: Set the configuration of the pipelines

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

#### Parameters

* `pipelines`: *Required.* Array of pipelines to configure.
Must be non-nil and non-empty. The structure of the `pipeline` object is as follows:

 - `name`: *Required.* Name of pipeline to be configured.
 Maps to `-p my-pipeline-name` in `fly set-pipeline` command.

 - `config_file`: *Required.* Location of config file.
 Maps to `-c some-config-file.yml` in `fly set-pipeline` command.

 - `vars_files`: *Optional.* Array of strings corresponding to files
 containing variables to be interpolated via `{{ }}` in `config_file`.
 Maps to `-l some-vars-file.yml` in `fly set-pipeline` command.

## Developing<commit_msg>Update README to include dynamic configuration for out.<commit_after># Concourse Pipeline Resource

Interact with concourse pipelines from concourse.

## Installing

This resource is only compatible with Concourse versions 0.74.0 and higher
as no BOSH release is provided. Use this resource by adding the following to
the `resource_types` section of a pipeline config:

```yaml
resource_types:
- name: concourse-pipeline
  type: docker-image
  source:
    repository: robdimsdale/concourse-pipeline-resource
    tag: v0.6.3
```

The value for `tag` should be the latest tag in this repository.

The docker image is `robdimsdale/concourse-pipeline-resource`; the images are
available on
[dockerhub](https://hub.docker.com/r/robdimsdale/concourse-pipeline-resource).

The rootfs of the docker image is available with each release on the
[releases page](https://github.com/robdimsdale/concourse-pipeline-resource/releases).

The docker image is semantically versioned; these versions correspond to the git tags
in this repository.

## Source Configuration

* `target`: *Required.*  URL of your concourse instance e.g. `https://my-concourse.com`.

* `username`: *Required.*  Basic auth username for logging in to Concourse.
  Basic Auth must be enabled on the Concourse installation.

* `password`: *Required.*  Basic auth password for logging in to Concourse.
  Basic Auth must be enabled on the Concourse installation.

### Example Pipeline Configuration

#### Check

```yaml
---
resources:
- name: my-pipelines
  type: concourse-pipeline
  source:
    target: https://my-concourse.com
    username: some-user
    password: <PASSWORD>
```

#### In

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

```yaml
---
jobs:
- name: download-my-pipelines
  plan:
  - get: my-pipelines
```

#### Out - static

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

```yaml
---
jobs:
- name: set-my-pipelines
  plan:
  - put: my-pipelines
    params:
      pipelines:
      - name: my-pipeline
        config_file: path/to/config/file
        vars_files:
        - path/to/optional/vars/file/1
        - path/to/optional/vars/file/2
```


#### Out - dynamic

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

```yaml
---
jobs:
- name: set-my-pipelines
  plan:
  - put: my-pipelines
    params:
      pipelines_file: path/to/pipelines/file
```

## Behavior

### `check`: Check for changes to the pipelines.

Return a checksum of the concatenated contents of all pipelines.

### `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.

For example, if there are two pipelines `foo` and `bar` the config for the
first will be written to `foo.yml` and the second to `bar.yml`.

### `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.

Either static or dynamic configuration must be selected; using both is not allowed.

#### Parameters - static

* `pipelines`: *Required.* Array of pipelines to configure.
Must be non-nil and non-empty. The structure of the `pipeline` object is as follows:

 - `name`: *Required.* Name of pipeline to be configured.
 Maps to `-p my-pipeline-name` in `fly set-pipeline` command.

 - `config_file`: *Required.* Location of config file.
 Maps to `-c some-config-file.yml` in `fly set-pipeline` command.

 - `vars_files`: *Optional.* Array of strings corresponding to files
 containing variables to be interpolated via `{{ }}` in `config_file`.
 Maps to `-l some-vars-file.yml` in `fly set-pipeline` command.

#### Parameters - dynamic

* `pipelines_file`: *Required.* Path to dynamic configuration file. The contents of this file should look as follows:

  ```yaml
  ---
  pipelines:
  - name: my-pipeline
    config_file: path/to/config/file
    vars_files:
    - path/to/optional/vars/file/1
    - path/to/optional/vars/file/2
  ```

This is the same structure as Static configuration above, but in a file. See that section to determine which fields are optional and which are required.

## Developing
{'fraction_non_alphanumeric': 0.09914904589994843, 'fraction_numerical': 0.0025786487880350697, 'mean_word_length': 3.7971552257266543, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1388455', 'n_tokens_mistral': 2278, 'n_tokens_neox': 2169, 'n_words': 902}