As a Dev/DevOps I want a more agile way to manage the code duplication across the pipelines using templates. As of now the templates are allowed to use only once per pipeline, meaning there's no way to define a template for one pipeline and have a repo's .drone.yml using several templates that would kick off different (or same) pipelines with different parameters.
Example.
I have an app that I want to build for 3 different platforms (e.g. Windows, iOS, Android). The way I do it without a template is:
The build pipelines are identical with a small difference in some command line arguments, but quite large (300 lines).
The report pipeline waits for the others to finish, gathers the results and reports to slack.
It would great to leverage templates on the level of build pipeline here, so that the amount of code duplication reduces significantly.
As a result the above would change to smth like this:
I do want to clarify that a template yaml can contain multiple pipelines, however, a .drone.yml can only contain a single template. I completely agree that we should support multiple templates in the drone.yml file. I do think the current implementation could support your use case, as an immediate workaround.
@bradrydzewski thanks for that, I'm aware of the current capabilities. More than that - I've also built a separate repository for storing templates so that they are also version-controlled somehow and built an automation for auto-deployment to the drone server. If anyone is interested in details, I'm happy to share.
But still I think the feature of using multiple templates per .drone.yml is a must. I can think of an alternative approach - allow having more than one .drone.yml file per repository - each could contain 1 or more pipelines and just 1 template. That could also work.
As a Dev/DevOps I want a more agile way to manage the code duplication across the pipelines using templates. As of now the templates are allowed to use only once per pipeline, meaning there's no way to define a template for one pipeline and have a repo's .drone.yml using several templates that would kick off different (or same) pipelines with different parameters.
Example.
I have an app that I want to build for 3 different platforms (e.g. Windows, iOS, Android). The way I do it without a template is:
The build pipelines are identical with a small difference in some command line arguments, but quite large (300 lines).
The report pipeline waits for the others to finish, gathers the results and reports to slack.
It would great to leverage templates on the level of build pipeline here, so that the amount of code duplication reduces significantly.
As a result the above would change to smth like this:
The text was updated successfully, but these errors were encountered: