Context sharing between parent and child build

Description of the feature request

When using “Bitrise start build” / “Bitrise Wait for Build” I would like to be able to share resources.

Use case / for what or how I would use it

Build 1
|
Checkout
|
Start Build 2
|              \
Lint          Build 2
|               |
Wait         Unit Test
|              /
|            /
|          /
Send slack message

In order to perform this, I have to checkout the sources in both Build 1 and Build 2 which is a waste of time.
Jenkins allows for this by using “stash” in its parallel pipelines for exemple.

Hi,

Can you please list what resources you’d want to share?

The thing is, in case of bitrise.io you can run as many builds in parallel as you like and every build runs in a clean virtual machine. In case of Jenkins I guess you ran the mentioned Build 1 and Build 2 on the same node, otherwise the source code would not be available for Build 2.

In case of bitrise.io Build 1 and Build 2 are running on “different machines” - every build runs on a new “machine” or “host” (virtual machine).

You can of course utilize the Build Cache (https://devcenter.bitrise.io/caching/about-caching/) and other similar features which can provide a formalized way to “share” resources, but even these have to utilize a host independent storage or similar as the build host (virtual machine) is discarded after every single build and a new one is created.

A clean environment is crucial in reducing host specific side effects, things that e.g. a previous build could affect the outcome of a build which is performed after that. E.g. Build 1 installs a tool while Build 2 does not, it only uses that tool. If you’d run Build 2 on a new host or maybe rebuild it later that might fail due to the lack of the tool, unless you run Build 1 again before Build 2 on the same host.

It also helps to scale out builds, e.g. to make it possible to run pretty much any number of builds in parallel at the same time, only limited by your subscription’s concurrency count.

If you can list what kind of things you want to share between builds we can suggest solutions, e.g. for Source Code sharing: How to Cache the Source Code directory but keep in mind that anything you cache might affect the result of subsequent builds!