Re:Write Gitlab CI Pipelines in Python Code
by delusional on Thursday April 29, 2021 @05:46PM
(#26987204)
We use bamboo at my job, and it's java that generates a yaml file that is then shoved into bamboo. It's a completely shitshow. why would i use a turing complete language to generate a declarative yaml file containing turing complete shell scripts? Why not just write the shell script in the first place?
Re:Write Gitlab CI Pipelines in Python Code
by lyjackal on Thursday April 29, 2021 @07:05PM
(#26987951)
Because the shell scripts are only run from _within_ pipeline steps. Gitlab CI yaml has no way of conditionally creating the pipeline steps, or the step's contents.
Re:Write Gitlab CI Pipelines in Python Code
by DrSarez on Thursday April 29, 2021 @05:51PM
(#26987262)
That is interesting. In fact I've googled for it and found a blog post with really nastay Java code defining a pipeline. Of course, in code you can do nasty things and create insane pipelines. Thus I think it is good having both - the declarative base and a generator on top. The declarative base ensures having an easy way to get into pipeline mechanics. However if you plan to write really complex pipelines, the pipeline-as-code approach jumbs in. At this point your'e firm with the basics and know what your'e doing in code.
Amazon is doing the same with the Cloud Development Kit (CDK). With CDK you can code your infrastructure in a number of languages (java, csharp, .net, python, typescript), which was synthesized into cloud formation to be finally deployed. For smaller projects and teams not firm with one of those languages, plain CFN may be much better. However after learning CDK you won't create any infrastructure without it.
Now we’ve got a pipeline being defined by a declarative file being generated by code.