Multiple configurations -> same steps

Hi,

I was wondering what’s the best way to do sort steps looping.

As an example.
We have an iOS application which we want to put on Fabric but for 3 build configurations.
We want to make an Archive and Upload to fabric. For ‘Beta-Prod’ - ‘Beta-Stag’ - ‘InHouse’
So I’m looking for the best way to do these steps for these 3 configurations.
Also the configurations could be different for every app so it should be sort of dynamic. Maybe like an ENV var with different configurations. I have no clue what’s the best way to do it.

The reason it has to be dynamic is because we are looking to make like 1 generic bitrise.yml file for all the apps and only difference is the ENV vars.

Maybe would be cool to have like support for Jinja2?
http://dontfragment.com/using-python-yaml-and-jinja2-to-generate-config-files/

So you could do something like.

{% for build_config in $BUILD_CONFIGS %}
- xcode-archive@2.4.15:
    inputs:
    - export_method: "$BITRISE_EXPORT_METHOD"
    - configuration: build_config
- fabric-crashlytics-beta-deploy@2.2.4:
    inputs:
    - build_secret: "$FABRIC_BUILD_SECRET"
    - group_aliases_list: "$FABRIC_TESTER_GROUPS"
    - release_notes: '$GIT_CLONE_COMMIT_MESSAGE_BODY'
    - api_key: "$FABRIC_API_KEY"
{% endfor %}

And you will see all the steps in the workflow but of course you can’t edit it.

I hope my question is clear :smiley:

Friendly regards,

Seppe

Hello there!
You can solve it by creating 3 different workflows for the different cases, then you can set up different env.vars for all of them. then with a primary workflow you can trigger all three of them and they will build up after each other.
And of course they can all contain the same steps and everything.

For my understanding @seppe_r want to avoid duplications so don’t want to have 3 workflows containing common steps.
If that’s the intent then Utility Workflows may help.
You can define common steps inside utility workflow and use it in different regular workflows. Environment should be the same as in parent.

1 Like

That could be it. I will give it a try :slight_smile: thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.