Skip to content

Commit 95768ac

Browse files
committed
update readme - format_version
1 parent 53e977a commit 95768ac

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ one exposed by [GoCD API](https://api.gocd.org/current#get-pipeline-config).
6464
The format of environment configuration files is much simpler,
6565
you can find examples of correct environments at the [bottom](#environment).
6666

67+
### Format version
68+
69+
Please note that it is now recommended to declare `format_version` in each `*.gopipeline.json` or `*.goenvironment.json` file.
70+
Version `2` will be most likely introduced in GoCD v17.12.
71+
Currently it is recommended to declare consistent version in all your files:
72+
```
73+
{
74+
"format_version" : 1
75+
}
76+
```
77+
6778
#### Implementation note
6879

6980
This plugin leverages JSON message format used internally for GoCD server
@@ -74,14 +85,15 @@ of reading a very long schema, below you can find examples of all configuration
7485

7586
It is exactly like documented [here](https://github.com/tomzo/documentation/blob/1133-configrepo-extension/developer/writing_go_plugins/configrepo/version_1_0/config_objects.md)
7687

77-
It is close to [official xml schema](https://docs.gocd.org/16.1.0/configuration/configuration_reference.html)
78-
and also [official JSONs in pipeline configuration API](https://api.gocd.org/16.1.0/#get-pipeline-config)
88+
It is **close to** [official xml schema](https://docs.gocd.org/16.1.0/configuration/configuration_reference.html)
89+
and also [official JSONs in pipeline configuration API](https://api.gocd.org/current/#get-pipeline-config)
7990

8091
## JSON Configuration objects
8192

8293
1. [Environment](#environment)
8394
1. [Environment variables](#environment-variables)
8495
1. [Pipeline](#pipeline)
96+
* [Locking](#pipeline-locking)
8597
* [Mingle](#mingle)
8698
* [Tracking tool](#tracking tool)
8799
* [Timer](#timer)
@@ -156,10 +168,11 @@ Any variable must contain `name` and `value` or `encrypted_value`.
156168

157169
```json
158170
{
171+
"format_version" : 1,
159172
"group": "group1",
160173
"name": "pipe2",
161174
"label_template": "foo-1.0-${COUNT}",
162-
"enable_pipeline_locking": true,
175+
"enable_pipeline_locking" : false,
163176
"parameters": [
164177
{
165178
"name": "param",
@@ -188,10 +201,11 @@ Any variable must contain `name` and `value` or `encrypted_value`.
188201

189202
```json
190203
{
204+
"format_version" : 1,
191205
"group": "group1",
192206
"name": "pipe-with-template",
193207
"label_template": "foo-1.0-${COUNT}",
194-
"enable_pipeline_locking": true,
208+
"enable_pipeline_locking" : false,
195209
"template": "template1",
196210
"parameters": [
197211
{
@@ -209,6 +223,19 @@ Please note:
209223

210224
* Pipeline declares a group to which it belongs
211225

226+
### Pipeline locking
227+
228+
Expected since GoCD v17.12, you need to use `lock_behaviour` rather than `enable_pipeline_locking`.
229+
```
230+
"lock_behaviour" : "none"
231+
```
232+
233+
`lock_behaviour` can be one of:
234+
* `lockOnFailure` - same as `enable_pipeline_locking: true`
235+
* `unlockWhenFinished` -
236+
* `none` - same `enable_pipeline_locking: false`
237+
238+
212239
### Mingle
213240

214241
```json

0 commit comments

Comments
 (0)