You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using an older version, you'll need to drop the plugin JAR to `plugins/external`[directory](https://docs.gocd.org/current/extension_points/plugin_user_guide.html) in your server installation.
26
33
27
-
Plugin JARs can be downloaded from [releases page](https://github.com/tomzo/gocd-json-config-plugin/releases).
34
+
**Step 2**: Follow [the GoCD documentation](https://docs.gocd.org/current/advanced_usage/pipelines_as_code.html#storing-pipeline-configuration-in-json) to add a new configuration repository.
28
35
29
-
### Add configuration repository
36
+
You can use the example repository at: `https://github.com/tomzo/gocd-json-config-example.git` as a reference.
30
37
31
-
Follow [the GoCD documentation](https://docs.gocd.org/current/advanced_usage/pipelines_as_code.html#storing-pipeline-configuration-in-json) to add a new configuration repository.
38
+
In your config repo (`tomzo/gocd-json-config-example.git` in this case), ensure that your GoCD json config is suffixed with `.gopipeline.json` for pipelines and `.goenvironment.json` for environments. Give it a minute or so for the polling to happen. Once that happens, you should see your pipeline(s) on your dashboard.
32
39
33
-
You can use the example repository at: `https://github.com/tomzo/gocd-json-config-example.git`
34
-
35
-
## Configuration files
40
+
## File pattern
36
41
37
42
Using this plugin you can store any number of pipeline or environment
38
-
configurations without a versioned repository like git.
43
+
configurations in a versioned repository like git.
39
44
40
45
By default **pipelines** should be stored in `*.gopipeline.json` files
41
46
and **environments** should be stored in `*.goenvironment.json` files.
42
47
43
48
The file name pattern can be changed on plugin configuration page.
44
49
45
-
## Format
46
-
47
-
The pipeline configuration files should be stored in format *similar* to
48
-
one exposed by [GoCD API](https://api.gocd.org/current#get-pipeline-config).
49
-
50
-
The format of environment configuration files is much simpler,
51
-
you can find examples of correct environments at the [bottom](#environment).
52
-
53
-
### Format version
54
-
55
-
Please note that it is now recommended to declare the _same_`format_version` in each `*.gopipeline.json` or `*.goenvironment.json` file.
56
-
57
-
#### GoCD server version from 19.3.0 and beyond
58
-
59
-
Supports `format_version` value of `4`. In this version, support has been added to control the [display order of pipelines](#display-order-of-pipelines).
60
-
61
-
This server version also supports `format_version` of `3` and `2`. Using a newer `format_version` includes all the behavior of the previous versions too.
62
-
63
-
#### GoCD server version from 18.7.0 to 19.2.0
64
-
65
-
Supports `format_version` value of `3`. In this version [fetch artifact](#fetch) format was changed to include `artifact_origin`.
66
-
67
-
This server version also supports `format_version` of `2`. Using a newer `format_version` includes all the behavior of the previous versions too.
68
-
69
-
#### GoCD server version up to 18.6.0
70
-
71
-
Supports `format_version` value of `2`. In this version [pipeline locking](#pipeline-locking) behavior was changed.
72
-
73
-
74
50
# Validation
75
51
76
-
There is an ongoing effort to allow in-depth validation of configuration **before pushing configuration to the source control**. This is provided by [GoCD's preflight API](https://api.gocd.org/current/#preflight-check-of-config-repo-configurations) and [gocd-cli][https://github.com/gocd-contrib/gocd-cli](https://github.com/gocd-contrib/gocd-cli).
52
+
There is an ongoing effort to allow in-depth validation of configuration **before pushing configuration to the source control**. This is provided by [GoCD's preflight API](https://api.gocd.org/current/#preflight-check-of-config-repo-configurations) and [gocd-cli](https://github.com/gocd-contrib/gocd-cli).
77
53
78
54
You have several options to configure validation tools on your workstation:
79
55
* If you have a local docker daemon, use the [gocd-cli-dojo](https://github.com/gocd-contrib/docker-gocd-cli-dojo) image. Follow the [setup instructions](https://github.com/gocd-contrib/docker-gocd-cli-dojo#setup) in the image readme.
@@ -94,25 +70,18 @@ This command will parse and submit your json file to the configured GoCD server.
Where `-r` is the configuration repository id, which you have earlier configured on GoCD server. You can check it on config repos page of your GoCD server, at `/go/admin/config_repos`. It in the upper left corner of each config repo.
73
+
Where `-r` is the configuration repository id, which you have earlier configured on GoCD server. You can check it on config repos page of your GoCD server, at `/go/admin/config_repos`. It is in the upper left corner of each config repo.
98
74

99
75
76
+
# JSON Configuration reference
100
77
101
-
#### Implementation note
102
-
103
-
This plugin leverages JSON message format used internally for GoCD server
104
-
and plugin communication.
105
-
106
-
GoCD pipeline and environment configuration has very deep structure. So instead
107
-
of reading a very long schema, below you can find examples of all configuration elements.
108
-
109
-
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)
110
-
111
-
It is **close to**[official xml schema](https://docs.gocd.org/16.1.0/configuration/configuration_reference.html)
112
-
and also [official JSONs in pipeline configuration API](https://api.gocd.org/current/#get-pipeline-config)
78
+
The pipeline configuration files should be stored in format *similar* to
79
+
one exposed by [GoCD API](https://api.gocd.org/current#get-pipeline-config).
113
80
114
-
## JSON Configuration objects
81
+
The format of environment configuration files is much simpler,
82
+
you can find examples of correct environments at the [bottom](#environment).
115
83
84
+
1.[Format version](#format-version)
116
85
1.[Environment](#environment)
117
86
1.[Environment variables](#environment-variables)
118
87
1.[Pipeline](#pipeline)
@@ -145,6 +114,28 @@ and also [official JSONs in pipeline configuration API](https://api.gocd.org/cur
145
114
*[pluggable scm](#pluggable-scm)
146
115
*[configrepo](#configrepo)
147
116
117
+
118
+
### Format version
119
+
120
+
Please note that it is now recommended to declare the _same_`format_version` in each `*.gopipeline.json` or `*.goenvironment.json` file.
121
+
122
+
#### GoCD server version from 19.3.0 and beyond
123
+
124
+
Supports `format_version` value of `4`. In this version, support has been added to control the [display order of pipelines](#display-order-of-pipelines).
125
+
126
+
This server version also supports `format_version` of `3` and `2`. Using a newer `format_version` includes all the behavior of the previous versions too.
127
+
128
+
#### GoCD server version from 18.7.0 to 19.2.0
129
+
130
+
Supports `format_version` value of `3`. In this version [fetch artifact](#fetch) format was changed to include `artifact_origin`.
131
+
132
+
This server version also supports `format_version` of `2`. Using a newer `format_version` includes all the behavior of the previous versions too.
133
+
134
+
#### GoCD server version up to 18.6.0
135
+
136
+
Supports `format_version` value of `2`. In this version [pipeline locking](#pipeline-locking) behavior was changed.
137
+
138
+
148
139
# Environment
149
140
150
141
Configures a [GoCD environment](https://docs.gocd.org/current/configuration/managing_environments.html)
@@ -908,17 +899,18 @@ Then enter a docker container with java and gradle pre-installed, by running fol
908
899
dojo
909
900
```
910
901
911
-
# Contributing
902
+
# Issues and questions
912
903
913
-
Create issues and PRs if
914
-
* something does not work as you expect it,
915
-
* documentation is not good enough
916
-
* you have questions about GoCD behavior with remote configuration
904
+
* If you have **questions on usage**, please ask them on the [gitter chat room dedicated for configrepo-plugins](https://gitter.im/gocd/configrepo-plugins?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
905
+
* If you think there is a bug, or you have an idea for a feature and *you are not sure if it's plugin's or [GoCD](https://github.com/gocd/gocd/issues) fault/responsibity*, please ask on the chat first too.
917
906
918
-
There has been a long effort to make it possible to store configuration in SCMs,
919
-
so obviously there will be some errors in lots of new code. Please file issues
920
-
here or ask on [gitter chat for config-repo plugins](https://gitter.im/gocd/configrepo-plugins).
907
+
Please note this brief overview of what is done by the plugin:
908
+
* parsing files into json when GoCD server asks for it.
921
909
910
+
And this is done by the GoCD server:
911
+
* complex logic merging multiple config repo sources and XML
912
+
* validation of pipelines/stages/jobs/tasks domain
913
+
* any UI rendering
922
914
923
915
## Versioning
924
916
@@ -931,9 +923,19 @@ If you are submitting a new feature then please run a major version bump by
931
923
932
924
If you are submitting a fix, then do not change any versions as patch bump is made right after each release.
933
925
934
-
# License and Authors
935
926
936
-
License: Apache 2.0
927
+
# License
928
+
929
+
Copyright 2019 Tomasz Sętkowski
930
+
931
+
Licensed under the Apache License, Version 2.0 (the "License");
932
+
you may not use this file except in compliance with the License.
0 commit comments