Skip to content

Commit

Permalink
updated readme; added whitelist docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzo committed Jul 2, 2016
1 parent 0018b80 commit 231d299
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
54 changes: 41 additions & 13 deletions README.md
Expand Up @@ -2,26 +2,29 @@

# Go JSON configuration plugin

This is a Go server plugin which allows to keep pipelines and environments configuration
in version control systems supported by Go (git,svn,mercurial, etc.)
**Go pipeline configuration as code**

You can find an example repository at https://github.com/tomzo/gocd-json-config-example.git
This is a Go server plugin which allows to keep **pipelines** and **environments** configuration
in version control systems supported by Go (git,svn,mercurial, etc.).
See [this document](https://docs.google.com/document/d/1_eGZaqIz9ydnYQJ_Xrcb3obXc-T6jIfV_pgZQNCydVk/pub)
to find out what are Go's configuration repositories.

### Resources:

* You can find an example repository at https://github.com/tomzo/gocd-json-config-example.git
* Go [feature](https://github.com/gocd/gocd/issues/1133) on github

## Quickstart

### Early access

This plugin uses configuration repository extension in Go.
[Feature](https://github.com/gocd/gocd/issues/1133) is not
merged into official gocd repository. Currently you have to
build Go from [my fork](https://github.com/tomzo/gocd) to try this out.
Official Go release `16.6.0` has experimental support of this feature - **do not use in production**.

### Installation

First you must install the plugin in Go server.
You'll have to drop `.jar` to `plugins/external` [directory](https://docs.go.cd/current/extension_points/plugin_user_guide.html) in your server installation.
Plugin jars can be downloaded from [snap](https://snap-ci.com/tomzo/gocd-json-config-plugin/branch/master) or
from [releases page](https://github.com/tomzo/gocd-json-config-plugin/releases)
Plugin jars can be downloaded from [releases page](https://github.com/tomzo/gocd-json-config-plugin/releases).

### Add configuration repository

Expand All @@ -41,22 +44,24 @@ a section like this should be added:
</config-repo>
</config-repos>
...
<pipelines />
...
```

## Configuration files

Using this plugin you can store any number of pipeline or environment
configurations without a versioned repository like git.

By default pipelines should be stored in `*.gopipeline.json` files
and environments should be stored in `*.goenvironment.json` files.
By default **pipelines** should be stored in `*.gopipeline.json` files
and **environments** should be stored in `*.goenvironment.json` files.

The file name pattern can be changed on plugin configuration page.

## Format

The pipeline configuration files should be stored in format similar to
one exposed by [go API](https://api.go.cd/16.1.0/#get-pipeline-config).
The pipeline configuration files should be stored in format *similar* to
one exposed by [go API](https://api.go.cd/current#get-pipeline-config).

The format of environment configuration files is much simpler,
you can find examples of correct environments at the [bottom](#environment).
Expand Down Expand Up @@ -303,6 +308,29 @@ All materials:

SCM-related materials have `destination` field.

### Filter - blacklist and whitelist

All scm materials can have filter object:

* for **blacklisting**:
```json
"filter": {
"ignore": [
"externals",
"tools"
]
}
```

* for **whitelisting** (since Go `16.7.0` if [this](https://github.com/gocd/gocd/pull/2380) gets merged):
```json
"filter": {
"whitelist": [
"moduleA"
]
}
```

## Git

```json
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -22,12 +22,12 @@

<groupId>com.thoughtworks.go</groupId>
<artifactId>json-config-plugin</artifactId>
<version>0.2</version>
<version>0.2.1</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<go.target.version>16.1.0</go.target.version>
<go.target.version>16.6.0</go.target.version>
<go.version>${project.version}</go.version>
<plugin.version>${project.version}</plugin.version>
</properties>
Expand Down

0 comments on commit 231d299

Please sign in to comment.