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
Copy file name to clipboardExpand all lines: README.md
+14-59Lines changed: 14 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,77 +71,32 @@ This server version also supports `format_version` of `2`. Using a newer `format
71
71
Supports `format_version` value of `2`. In this version [pipeline locking](#pipeline-locking) behavior was changed.
72
72
73
73
74
-
# Syntax checking
74
+
# Validation
75
75
76
-
Since `0.3.2` plugin is an executable and supports basic syntax checking.
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).
77
77
78
-
## Usage with java installed
78
+
You have several options to configure validation tools on your workstation:
79
+
* 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.
80
+
* If you don't want to use docker, you'll need to [setup `gocd-cli` on your host](https://github.com/gocd-contrib/gocd-cli).
79
81
80
-
You need to download the `jar` from releases page and place it somewhere convenient.
81
-
For example `/usr/lib/gocd-json-plugin/json-config-plugin.jar`.
82
-
Then to validate your `gopipeline.json` file run something like:
This is a product in development, so its command syntax is not stable and there are no distributed binaries yet.
90
-
91
-
The `gocd` tool is built in [golang](https://golang.org/) so you will need to familiarize yourself with how to set up your [go workspace](https://golang.org/doc/code.html#Workspaces).
92
-
93
-
Build the `gocd` binary:
82
+
Either way you'll have `gocd` binary in your `PATH` or inside the docker container.
Follow the steps on [https://github.com/gocd-contrib/gocd-cli](https://github.com/gocd-contrib/gocd-cli) to install the plugin jar to the correct place.
102
-
103
-
Then:
84
+
## Syntax validation
104
85
86
+
This will check general validity of the yaml file, without talking to the 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.
98
+

138
99
139
-
## Usage with docker only
140
-
141
-
```
142
-
docker run -ti --rm --volume $(pwd):/ide/work tomzo/gocd-json-ide:<plugin-version> bash
# When tagging a docker image using docker 1.8.3, we can use `docker tag -f`.
91
-
# When using docker 1.12, there is no `-f` option, but `docker tag`
92
-
# always works as if force was used.
93
-
docker tag -f "${AIT_DOCKER_IMAGE_NAME}:${testing_image_tag}""${public_image_name}:${production_image_tag}"|| docker tag "${AIT_DOCKER_IMAGE_NAME}:${testing_image_tag}""${public_image_name}:${production_image_tag}"
94
-
docker tag -f "${AIT_DOCKER_IMAGE_NAME}:${testing_image_tag}""${public_image_name}:latest"|| docker tag "${AIT_DOCKER_IMAGE_NAME}:${testing_image_tag}""${public_image_name}:latest"
0 commit comments