This is useful for projects with a big footprint, where checkouting could take a couple minutes.
The proposed solution works as follow:
A project must first be configured to do an update instead of a fresh checkout using the project configuration feature, by setting the "bzk.scm.reuse" key to "true". The cli can be used to this effect: bzk project config set <project-name> bzk.scm.reuse true
When the server receives a start job request, it reads this configuration value. If set to true, a project-level ($BZK_HOME/build/<project-id>/source) folder is created if it does not already exist, and gets mounted into orchestration at /bazooka/source, on top of the job directory which still gets mounted at /bazooka
The orchestration container is also passed an env var BZK_REUSE_SCM_CHECKOUT set to 1
In orchestration, and upon startup, if the BZK_REUSE_SCM_CHECKOUT env var is set, the scm checkout container is started with the env var UPDATE set to a non empty value. Depending on the project scm (git or hg for the time being), the container performs an in place update (git pull or hg update for example). See bazooka-ci/bazooka-scm-git#1 and bazooka-ci/bazooka-scm-hg#1 for details on the specifics
If this fails, orchestration re-runs the scm container again without the UPDATE env var, in case this is the first build or the osurce directory was deleted, which would perform a regular fresh checkout
This is useful for projects with a big footprint, where checkouting could take a couple minutes.
The proposed solution works as follow:
bzk project config set <project-name> bzk.scm.reuse true
$BZK_HOME/build/<project-id>/source
) folder is created if it does not already exist, and gets mounted into orchestration at/bazooka/source
, on top of the job directory which still gets mounted at/bazooka
BZK_REUSE_SCM_CHECKOUT
set to1
BZK_REUSE_SCM_CHECKOUT
env var is set, the scm checkout container is started with the env varUPDATE
set to a non empty value. Depending on the project scm (git or hg for the time being), the container performs an in place update (git pull or hg update for example). See bazooka-ci/bazooka-scm-git#1 and bazooka-ci/bazooka-scm-hg#1 for details on the specificsUPDATE
env var, in case this is the first build or the osurce directory was deleted, which would perform a regular fresh checkoutFixes #145.