Do you want to run a custom script in your builds or do you want to experiment with things you just found on the DevCenter, but would love to make the process faster?
Here's how to do that, it’s actually super simple:
- Install the Bitrise CLI, which is the exact same runner which runs the builds on the bitrise.io VMs. You can find it here.
- Note: the CLI is open source, find repo and code here.
- Open your Terminal / Command Line
- Just to be sure, if you've just installed the CLI, run: bitrise setup (This will prepare everything required for running the builds/tools.)
- Prepare a bitrise.yml / config:
- Either download your config from bitrise.io (Workflow Editor -> bitrise.yml: that’s the build config which you can download and save as a bitrise.yml file, and run it with the CLI.
- Or if you just want to run quick experiments, generating a new config which will only include the things you want to test might be even faster. In your Terminal / Command Line run these:
- mkdir /tmp/bitrise-experiment
- cd /tmp/bitrise-experiment
- bitrise init --minimal
- That’s all, the init will generate a base bitrise.yml config for you in the directory you run the bitrise init command in (in this example /tmp/bitrise-experiment)
- Once you have the config you can either edit the bitrise.yml manually, or use the Workflow Editor, which is part of the CLI!
- To open the Workflow Editor just run bitrise :workflow-editor in the directory where the bitrise.yml is located.
- Ready for running a “build”? You can run it in your Terminal / Command Line with bitrise run WORKFLOW-ID.
- Run this command in your Terminal / Command Line in the directory where the bitrise.yml is located at.
- To list all the available workflow IDs from your build config (bitrise.yml) simply run bitrise run without specifying any workflow ID, that will print an error and list all the available workflows.
That’s pretty much all. You can now experiment with your config locally (on your Mac/Linux) quickly using the tips/steps above.
If you have any questions feel free to leave a comment below!
Happy iterating! 🙂