Skip to content
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

Move current GoCD templates into Yaml. Or find a way to reference global Yaml templates #132

Closed
sebawagner opened this issue Oct 13, 2019 · 5 comments

Comments

@sebawagner
Copy link

Hi,

I saw various discussion of how to do templating using GoCD and Yaml.

However they seem to be different to what GoCD does. Basically I would just like to move existing templates from the "template" section into Yaml. For the same reason why doing pipelines in Yaml (version control, performs better then having infinite growing config.xml, easy of use).

The other issues raised against the gocd-yaml-config-plugin project seem to come up with new alternative ways of templating. Which may be a valid idea. But I think its yet another abstraction on top of an already abstract concept.

Basically I think the easiest would be to just re-create the existing functionality that GoCD has.

How hard would it be to inject Yaml templates into the current template section of the config.xml ? Or is that even somehow possible already ?

@tomzo
Copy link
Owner

tomzo commented Oct 14, 2019

Hi @sebawagner

Basically I think the easiest would be to just re-create the existing functionality that GoCD has.

Unfortunately, this is very hard due to the way xml config is implemented on the GoCD side. It is probably easier to built an independent template mechanism in plugins rather than changing the core config implementation. Also, making plugins capable of expanding templates allows to roll out more implementations.

How hard would it be to inject Yaml templates into the current template section of the config.xml ? Or is that even somehow possible already ?

Why would would you want to do that? I thought that you want to move the templates from the central xml config to external repositories. I'm also not sure what you mean by 'Yaml templates' in this case.

You might want to see the discussion on gocd/gocd#5675

@sebawagner
Copy link
Author

sebawagner commented Oct 14, 2019

@tomzo yeah gocd/gocd#5675 is basically what I meant

There is a comment in there that pretty much sums it up:

The only piece we are missing from the current template feature is the ability to have them in source control rather than in the main GoCD config XML.

See: gocd/gocd#5675 (comment)

I agree, best would be having gocd/gocd#5675

@lobsterdore
Copy link

@sebawagner you can use Gomatic to configure Templates from code - https://github.com/gocd-contrib/gomatic, that's what we have ended up doing due to the lack of Template support via YAML. We configure a lot of our pipelines using Gomatic, allowing us to offer a devs a very simple interface for creating new service pipelines.

@kniec
Copy link

kniec commented Jul 9, 2020

@lobsterdore do you happen to have an example of how you use it?

@tomzo
Copy link
Owner

tomzo commented Sep 13, 2020

I'm closing this as a duplicate of #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants