Support referenced workflows inside a bitrise.yml

#1

Description of the feature request

Allow yml files to be referenced as workflows within the bitrise.yml

For example the “_setup” workflow would not be inlined in every workflow’s bitrise.yml and could be referenced using a relative path.

Use case / for what or how I would use it

When using GitHub + Bitrise API to manage a large number of workflows changing the _setup workflow must be changed in every bitrise.yml.

This would make managing Bitrise at scale much easier and allow for updating and tracking changes to yml files much easier

0 Likes

#2

But where would the _setup.yml live? :thinking: I mean if this is to "manage a large number of workflows " that implies those live in separate repositories too, right?

0 Likes

#3

I do agree with the intent though, we see this issue as well, ideally we could have one repo which is like a “module” repo (if you used terraform modules before, which are reusable components similar to our steps) that could include multiple modules (reusable workflows) which could be referenced in other projects (which live in a separate repository).

This’d mean that the workflow referencing should support specifying the “modules”/“workflows” repository too :thinking: or of course you could just have that other repo as a submodule or such, but that seems to be a bit more hassle to setup.

0 Likes

#4

Terragrunt’s similar feature https://terragrunt.gruntwork.io/docs/features/keep-your-terraform-code-dry/

0 Likes

#5

The workaround I used for this was to (ab)use yaml anchors.

In one workflow:

steps:
  - &install-tools
    script:
      inputs: [lots of stuff]
  - &carthage
    carthage:
      inputs: [stuff]
...
steps:
  - *install-tools
  - *carthage

Not perfect, but it helps keep things DRY

0 Likes

#6

Non-bitrise.yml files could be stored anywhere so long as they can be updated via api and referenced inside a bitrise.yml.

One folder you from every bitrise.yml should make it easier to manage

0 Likes