Currently, in order to validate a repository with preflight api we use following command:
gocd configrepo --yaml preflight -r my-existing-repo my-pipeline.gocd.yaml
Or for many files something like
gocd configrepo --yaml preflight -r my-existing-repo *.gocd.yaml
It makes sense, all arguments are absolutely required for the API call.
Feature proposition
I'd like to propose following convention, in order to shorter above commands.
In config-repo users would add a file, say .gocd-cli.yaml with following content
---
config_repo_id: my-repo-id
plugin_id: yaml.config.plugin
file_pattern: "**/*.gocd.yaml"
registered: true
The gocd-cli would search for such file in current directory. If file is found, then these values can be used instead providing them each time as arguments.
Benefits
- The result, would shorten the command to just
gocd configrepo preflight
- It is also much less error prone. Getting the
repo_id right can be annoying.
My point is that all these values are pretty much constant throughout the lifespan of the configuration repository - same repo_id, same plugin, same file pattern.
Extension in the longer term
I suppose gocd-cli could be used in the future to add config repository to gocd through API, without ever going into the UI.
There could be an operation like this
gocd configrepo new -r my-new-id --yaml
It would:
- create a boiler plate
ci.gocd.yaml file
- generate
.gocd-cli.yaml with extra field registered: false to point that repo is not on gocd server yet.
Then user edits the ci.gocd.yaml as needed. During this time it is already OK to run:
gocd configrepo preflight
Then user runs
which adds repo to GoCD.
Then commit and push.
@arvindsv @marques-work what do you think?
Currently, in order to validate a repository with preflight api we use following command:
Or for many files something like
It makes sense, all arguments are absolutely required for the API call.
Feature proposition
I'd like to propose following convention, in order to shorter above commands.
In config-repo users would add a file, say
.gocd-cli.yamlwith following contentThe gocd-cli would search for such file in current directory. If file is found, then these values can be used instead providing them each time as arguments.
Benefits
repo_idright can be annoying.My point is that all these values are pretty much constant throughout the lifespan of the configuration repository - same repo_id, same plugin, same file pattern.
Extension in the longer term
I suppose
gocd-clicould be used in the future to add config repository to gocd through API, without ever going into the UI.There could be an operation like this
It would:
ci.gocd.yamlfile.gocd-cli.yamlwith extra fieldregistered: falseto point that repo is not on gocd server yet.Then user edits the
ci.gocd.yamlas needed. During this time it is already OK to run:Then user runs
which adds repo to GoCD.
Then commit and push.
@arvindsv @marques-work what do you think?