How to experiment with Bitrise configs locally, on your Mac/Linux

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?

If you do, this is the right place for you!

It’s actually super simple:

  1. Install the Bitrise CLI, which is the exact same runner which runs the builds on the bitrise.io VMs. Bitrise CLI
  2. Open your Terminal / Command Line
  3. Just to be sure, if you just installed the CLI, run: bitrise setup
    • This will prepare everything required for running the builds/tools.
  4. 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:
      1. mkdir /tmp/bitrise-experiment
      2. cd /tmp/bitrise-experiment
      3. bitrise init --minimal
      4. 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
  5. Once you have the config you can either edit the bitrise.yml manually, or use the Workflow Editor, which is now part of the CLI!
    • To open the Workflow Editor just run bitrise :workflow-editor in the directory where the bitrise.yml is located.
  6. 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’d have any questions feel free to leave a comment below!

Happy Iterating! :wink:

3 Likes

Hi, I’m getting the following when I try to run the command line bitrise setup

Installing ⣯Download failed, retrying ...
Setup failed, error: Failed to do common/platform independent setup, error: Envman failed to install: failed to download, error: failed to download from (https://github.com/bitrise-io/envman/releases/download/1.1.13/envman-Darwin-x86_64), error: Get https://github.com/bitrise-io/envman/releases/download/1.1.13/envman-Darwin-x86_64: x509: certificate signed by unknown authority

Hi @kuassivi,

Based on the timing of your comment I suspect it was caused by the GitHub outage last week.
If that’s indeed the case then you can just run bitrise setup again (or bitrise setup --clean to do a full clean setup) and that will work.

If it would not work then please create a #issues:steps-and-tool-issues report so that we can debug it - #how-to topics are not tracked for issues by the support team, that’s why the long delay in response here :slight_smile:

2 Likes

To know the entire process for the configuration of the Linux and that you can also get that kind of things from the help of the Apple support for the required help which you want for the guidance to make that kind of things perfect for you.

Hi @adamdavis44!

Thanks for the reply but we are not entirely sure what you are referring to here, can you explain please? :slightly_smiling_face:

Hi @viktorbenei
I managed to run it locally working like charm.
However in bitrise.io or when I do full clean git clone I’m having issue in gradle-runner step

> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
   > Could not resolve project :apptivityframework.
     Required by:
         project :app
         project :app > project :data
      > Unable to find a matching configuration of project :apptivityframework: None of the consumable configurations have attributes.

note that apptivityframework is git submodule while data module is local project

Hey @zack_viplive, could you send us your build URL or log file for investigation? Preferably on our on site-chat or in an #issues thread here? Please do!

Hi @bitce Thanks for the response, I’ve sent you on site chat.

Thanks! We’ll help you sort it out as soon as we can!

1 Like

Hello.
How I can use Secrets Variables with Bitrise CLI on Mac?
Thanks.

Hello there!

You can’t, in that matter they are used as env vars.
the concept of secret kinda looses its meaning on a local environment.
it is not running on the cloud, so no one else can get to it unless they use your computer, and from that point…

Hey,
Thank you.

But it seems I resolved a problem. I created file .bitrise.secrets.yml with secrets variables (which listed in web console on Bitrise) in the root folder of my project and it works.

3 Likes

I’m glad you found the solution, I did not know this feature, I’m rarely using the cli :sweat_smile:

You’re welcome! :joy:

1 Like

Hi there,

can I have more than one project locally at the same time and have them running parallel?

Hello there!

Yes you can do it, if you run them from different terminals then there is no limit.

1 Like

No workflows loading for me and getting Exception: RespondWith: Error: json: unsupported type: map[interface {}]interface {} in terminal.

Any ideas? And which json is this?

No problem with CRUD’ing workflows on the site.

1 Like

Hi Leo,

I hope you are doing well. Are you still experiencing this issue?

Yes, and so are others: https://github.com/bitrise-io/bitrise-workflow-editor/issues/358

We haven’t had a reply in a year @bitce

Hi, has anyone had issues with using generic file storage locally?