Skip to content

Commit 6afe16c

Browse files
committed
updated readme with table of contents; release 0.3.8
1 parent 4c87f42 commit 6afe16c

File tree

2 files changed

+73
-71
lines changed

2 files changed

+73
-71
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 0.3.8 - Unreleased
1+
### 0.3.8 (2019-May-01)
22

33
* switch build system to use open source openjdk-dojo image \#17574
44
* remove docker image from this repo, use [new image](https://github.com/gocd-contrib/docker-gocd-cli-dojo) with gocd-cli

README.md

Lines changed: 72 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,45 @@ in version control systems supported by GoCD (git, svn, mercurial, etc.).
1111
See [this document](https://docs.gocd.org/current/advanced_usage/pipelines_as_code.html)
1212
to find out what GoCD's configuration repositories are.
1313

14-
### Resources:
14+
# Table of contents
1515

16-
* You can find an example repository at https://github.com/tomzo/gocd-json-config-example.git
17-
* Original GoCD [issue](https://github.com/gocd/gocd/issues/1133) on GitHub
16+
1. [Setup](#setup)
17+
1. [File pattern](#file-pattern)
18+
1. [Validation](#Validation)
19+
1. **[Format reference](#JSON-Configuration-reference)**
20+
1. [Format version](#Format-version)
21+
1. [Issues and questions](#Issues-and-questions)
22+
1. [Development](#Development)
23+
1. [License](#License)
1824

19-
## Quickstart
25+
# Setup
2026

21-
### Installation
27+
**Step 1**: GoCD versions newer than `17.8.0` already have the plugin bundled. You don't need to install anything.
2228

23-
GoCD versions newer than `17.8.0` already have the plugin bundled. You don't need to do anything else.
29+
If you're using GoCD version *older than 17.8.0*, you need to install the plugin in the GoCD server. Download it from
30+
[the releases page](https://github.com/tomzo/gocd-json-config-plugin/releases) and place it on the GoCD server in
31+
`plugins/external` [directory](https://docs.gocd.org/current/extension_points/plugin_user_guide.html).
2432

25-
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.
2633

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.
2835

29-
### Add configuration repository
36+
You can use the example repository at: `https://github.com/tomzo/gocd-json-config-example.git` as a reference.
3037

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.
3239

33-
You can use the example repository at: `https://github.com/tomzo/gocd-json-config-example.git`
34-
35-
## Configuration files
40+
## File pattern
3641

3742
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.
3944

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

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

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-
7450
# Validation
7551

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).
7753

7854
You have several options to configure validation tools on your workstation:
7955
* 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.
9470
```
9571
gocd configrepo preflight --json -r gocd-json-config-example *.gopipeline.json
9672
```
97-
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.
9874
![config repo id](json_config_repo_id.png)
9975

76+
# JSON Configuration reference
10077

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).
11380

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).
11583

84+
1. [Format version](#format-version)
11685
1. [Environment](#environment)
11786
1. [Environment variables](#environment-variables)
11887
1. [Pipeline](#pipeline)
@@ -145,6 +114,28 @@ and also [official JSONs in pipeline configuration API](https://api.gocd.org/cur
145114
* [pluggable scm](#pluggable-scm)
146115
* [configrepo](#configrepo)
147116

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+
148139
# Environment
149140

150141
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
908899
dojo
909900
```
910901

911-
# Contributing
902+
# Issues and questions
912903

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.
917906

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.
921909

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
922914

923915
## Versioning
924916

@@ -931,9 +923,19 @@ If you are submitting a new feature then please run a major version bump by
931923

932924
If you are submitting a fix, then do not change any versions as patch bump is made right after each release.
933925

934-
# License and Authors
935926

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.
933+
You may obtain a copy of the License at
934+
935+
http://www.apache.org/licenses/LICENSE-2.0
937936

938-
Authors:
939-
* Tomasz Sętkowski <[email protected]>
937+
Unless required by applicable law or agreed to in writing, software
938+
distributed under the License is distributed on an "AS IS" BASIS,
939+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
940+
See the License for the specific language governing permissions and
941+
limitations under the License.

0 commit comments

Comments
 (0)