Skip to content

Commit 7f26b52

Browse files
committed
change introduction in plugin readme
1 parent fbde088 commit 7f26b52

File tree

1 file changed

+57
-8
lines changed

1 file changed

+57
-8
lines changed

README.md

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,76 @@
22

33
# Go JSON configuration plugin
44

5+
This is a Go server plugin which allows to keep pipelines and environments configuration
6+
in version control systems supported by Go (git,svn,mercurial, etc.)
7+
8+
You can find an example repository at https://github.com/tomzo/gocd-json-config-example.git
9+
10+
## Quickstart
11+
12+
### Early access
13+
514
This plugin uses configuration repository extension in Go.
615
[Feature](https://github.com/gocd/gocd/issues/1133) is not
7-
merged into official gocd repository. But it will be soon possible
8-
to build Go from [my fork](https://github.com/tomzo/gocd) to try this out.
16+
merged into official gocd repository. Currently you have to
17+
build Go from [my fork](https://github.com/tomzo/gocd) to try this out.
18+
19+
### Installation
20+
21+
First you must install the plugin in Go server.
22+
You'll have to drop `.jar` to `/plugins` directory in your server installation.
23+
Plugin jars can be downloaded from [snap](https://snap-ci.com/tomzo/gocd-json-config-plugin/branch/master)
24+
25+
### Add configuration repository
26+
27+
There is no UI to add configuration repositories so you'll have to edit the
28+
config XML.
29+
You will need to add `config-repo` section within `config-repos`.
30+
If `config-repos` does not exist yet then you add it right above first `<pipelines />`.
31+
32+
To add all configurations from git repository `https://github.com/tomzo/gocd-json-config-example.git`
33+
a section like this should be added:
34+
35+
```xml
36+
...
37+
<config-repos>
38+
<config-repo plugin="json.config.plugin">
39+
<git url="https://github.com/tomzo/gocd-json-config-example.git" />
40+
</config-repo>
41+
</config-repos>
42+
...
43+
```
944

1045
## Configuration files
1146

12-
This plugin let's you define 2 types of configuration files:
13-
* pipeline - single file defines a single pipeline
14-
* environment - single file defines Go environment
47+
Using this plugin you can store any number of pipeline or environment
48+
configurations without a versioned repository like git.
49+
50+
By default pipelines should be stored in `*.gopipeline.json` files
51+
and environments should be stored in `*.goenvironment.json` files.
52+
53+
The file name pattern can be changed on plugin configuration page.
1554

1655
## Format
1756

57+
The pipeline configuration files should be stored in format similar to
58+
one exposed by [go API](https://api.go.cd/16.1.0/#get-pipeline-config).
59+
60+
The format of environment configuration files is much simpler,
61+
you can find examples of correct environments at the [bottom](#environment).
62+
63+
#### Implementation note
64+
1865
This plugin leverages JSON message format used internally for Go server
1966
and plugin communication. The only difference between these schemas is the
20-
fact that in plugin format a pipeline can contain a `group` property. Plugin
67+
fact that in plugins format a pipeline can contain a `group` property. Plugin
2168
transforms that into official schema where groups contain many pipelines.
2269

2370
Go pipeline and environment configuration has very deep structure. So instead
24-
of writing very long schema below are examples of many configuration elements.
25-
It is very close to [official xml schema](http://www.go.cd/documentation/user/15.2.0/configuration/configuration_reference.html)
71+
of reading a very long schema, below you can find examples of all configuration elements.
72+
73+
It is very close to [official xml schema](http://www.go.cd/documentation/user/16.1.0/configuration/configuration_reference.html)
74+
and also [official JSONs in pipeline configuration API](https://api.go.cd/16.1.0/#get-pipeline-config)
2675

2776
1. [Pipeline](#pipeline)
2877
* [Mingle](#mingle)

0 commit comments

Comments
 (0)