Has anyone explored using Pulumi to template CI pi...
# general
e
Has anyone explored using Pulumi to template CI pipelines (GitHub Actions, GitLab CI, etc)? I think the existing functionality around Input and Output could be very useful for something like this. It would essentially be going from code to YAML, just like Pulumi can do for k8s manifests.
s
You can definitely do this in AWS with CodePipeline/CodeBuild. There's also an Azure DevOps provider.
e
Makes sense, but nothing for GitLab / GitHub?
Particularly with YAML as the output instead of creating resources
Some context: I built something without Pulumi, but realizing that it needs some sort of concept of deferred templating, similar to Pulumi’s input/output system, to unlock the full potential of the idea. https://github.com/adriangb/ciscript
I’ve seen plenty of private orgs building very complex pipelines on GitHub/GitLab and even some open source projects have enough going on in their CI setups that they could benefit from this approach
e
I have some ideas around extending pulumi to support this. I would love to write GHA yaml files with code rather than yaml, we'll probably play with this during a hackweek some time but it's more in the "fun experiments" rather than "business priority" camp.
e
Yeah makes sense. Seems kinda hard to sell since I imagine most users would template locally and not use a service. But it could be a cool way to introduce folks to the ecosystem! When’s your hack week btw?
e
Next one is next week but I've already got something else lined up for that (although if that idea finishes early, this was going to be my back up hack project), but we have one every 3 months. So the next would probably be end of March.
e
Cool will keep an eye out, might experiment in the meantime
s
@eager-wall-56838 We have internal tooling to generate GHA for our providers, but it's not Pulumi per se. It is open source if you're interested.
e
Sure shoot me a link!
s
Specifically, the
provider-ci
subdirectory
e
So I did end up ending my first hackweek project early (pluginification of secret providers, proved out the interfaces, need to do a load of engine clean up to really enable it, https://github.com/pulumi/pulumi/issues/11493) so I had a look at the idea of turning any JSON schema into a pulumi object model, the results of that are at https://github.com/Frassle/pulumi-jsonschema/ It needs a load more work, especially for the more complicated combinators like allOf/anyOf/oneOf but it seems a promising start. I'm going to see if I can get it to give a good object model based on the GHA schema from "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json".