Open iocanel opened 7 years ago
Yeah I like that, I recently started to do something similar using properties..
deployOpenShiftNode(openshiftConfigSecretName: 'test-cluster-oc-config'){
// do stuff
}
https://github.com/fabric8io/generator-backend/blob/master/Jenkinsfile#L56
The pod templates that we are currently using (e.g. the maven template) refer to resources managed by gofabric8 and are used to store stuff like settings, ssh keys, gnupgp keys and more.
It would be nice, if we had a flavor of the templates, without all these fixed resources, or if those were optional.
Something like this would allow the user to get started, regardless of how he setup the environment or what jenkins image he uses. Of course, he wouldn't be able to enjoy the Fabric8 in its full length, but he could easily hack a pipeline that does a maven build, run the integration/system tests and even update internal environments. Then he gradually adds more things to the mix. I think that a step by step approach is really important, as it gives time to the user to digest and better understand how to use our stuff. It also gives us more flexibility.
The implementation is the tricky part....
What I'd like to avoid is an endless chain of if then else. What I'd also like to avoid is having tons of different templates for the same thing.
What could possibly make sense here, is to leverage template nesting / composition. So we could have something like a light maven template called
withMaven
and additional templates that attach the secrets or the rest of the resources (e.g. to define the ssh keys:withSsh
). We could then bind them together:And if this is starting to getting verbose, we could hack the
withFabric8
that adds the things we need with a simple declaration.