-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds GoCD template support #81
Conversation
Adds ability to specify GoCD templates from YAML, not working currently.
@tomzo I can't seem to get this functionality working so perhaps you can point me in the right direction? I've copied and paired down the pipeline parser in order to support templates, however I cannot get templates to appear in GoCD using this test repo - https://github.com/lobsterdore/gocd-yaml-tester/blob/master/template.gocd.yaml. I've done some debugging and I can see that the YAML config plugin is indeed collecting all the template configuration from the test repo, however it never seems to wind up in GoCD, I don't know much about GoCD or it's plugin architecture so I feel like I am missing a piece of the puzzle here, do I need to update an API request somewhere? I've searched through this plugin and I can't seem to find the answer. |
Hi @lobsterdore
I'm afraid there is much more to be changed on the server side than in the plugin. Most of config-repo functionally is actually implemented there as part of https://github.com/gocd/gocd/issues//1133 and all PRs related. We have an on-going discussion on improvements to the config-repos in gocd/gocd#5175, including the templates. You should also see #2 |
@tomzo I had a feeling it would be way more complicated than this tiny PR :) Could we utilise the REST API template endpoints to handle this? I know it's a bit of a hack, but it could get templates working whilst we wait for the necessary updates to GoCD, we could extract the parsed templates JSON, use this to update the templates via API calls and then process the rest of the JSON via the plugin APIs. |
It could work. But I think that is a hack with possibly a lot of unintended consequences. If I commit to implementing templates support, I would do it the right way. That was my approach in gocd/gocd#1133 and I stick to this. Otherwise its a lot of workarounds and wasted work in the end. For your particular needs - If you are already willing to use API to create templates, then perhaps consider using gomatic or terraform GoCD provider to do that. |
@tomzo thanks for the feedback, it's much appreciated. I wasn't aware of Gomatic so I think I will head down that route for now, I will take a look at your comments as well. Gonna close this PR for now since it's now useful as it stands. |
Adds ability to specify GoCD templates from YAML, not working
currently.