Build configuration per workflow

Hi there! Iā€™m looking for a way to select the build configuration based on which workflow is being executed, I looked through your FAQ but I couldnā€™t see anything :blush:

e.g.
master = Release
release = Release
develop = Test
features = Debug

2 Likes

Hi @nick.briscoe,

Thanks for asking this here! :wink:

Itā€™s actually pretty simple to do, using multiple workflows and either Workflow Env Vars or specifying the parameter directly for the step.

All you have to do is:

  1. Create a workflow for every configuration which should have different configuration(s) (master, release, develop, ā€¦)
  2. Set the right configuration for every workflow, e.g. select the develop one, and set the configuration (or any other parameter in any step) to the one you want to. Example if you use e.g. the Xcode Archive step and want to specify a configuration there:
    1. Select the related workflow
    2. Select the related step (Xcode Archive in this case)
    3. Select the related input/option (in case of Xcode Archive itā€™s the Configuration name option
    4. Set the value/configuration you want to
  3. And the last step is to specify which workflow to use when, using the Triggers / Trigger Map feature (related docs: http://devcenter.bitrise.io/webhooks/trigger-map/).

E.g. run run the ā€œdeployā€ workflow for every code push on master, and run the ā€œprimaryā€ workflow for code push on any other branch and for pull requests:

trigger_map:
- push_branch: "master"
  workflow: deploy
- push_branch: "*"
  workflow: primary
- pull_request_target_branch: "*"
  workflow: primary

Source: http://devcenter.bitrise.io/webhooks/trigger-map/#a-very-simple-two-workflow-cicd-setup

If you have any questions just let us know! :slight_smile:

1 Like