Reusable environments


This feature is under development, changes are expected


Reusable environments is a very useful feature that allows to save a environment at a arbitraty step and reuse later in other environment.

This feature has been desinged and implemented with the goal of save resources.


For example, in the case of a NodeJS project, you can save a environment after run npm ci and later add npm i. This will be faster as the dependencies are already installed.


For example, in the case of a Composer based project, you can save a environment after run composer install so next time it runs on a new environment it will just install the missing dependencies.


In any other case, if your environment have some OS level dependencies, like packages, libraries or whatever, you can install them once in the reusable environment.

Also, new environment will save space as they reuse a common image of dependencies.


Configuration about when to create a reusable environment and later where to reuse this is specified in the Qaack file.

There are two directives in the qaack file:

  • make_reusable for specify when to save

  • reuse to specify which reusable environment choose


If there are differences in the configuration between saved environment and the reusing one, it could result in a unexpected beahviour. Qaack will reuse if all the services matches and the step specified to save exists.

It wont check if new commands have been included, deleted or reorganized has changed.

Lets see each one:


The complete syntax of this directive is:

    on: [service].[step]
      - [git_reference_name]

So the options are:

reusable_label: you can create multiple reusable environments from the same environment. Each one will be identified by a label, which is specified here.

on: This option specifies in which point of the build process will the environment be saved. Its given in the format of [service_name].[step_name]. It will save AFTER the execution of the given step, and the environment reusing will NOT execute it

where: This is a list of git references to restrict when the environments will be saved. This is useful to avoid that all branches saves a environment. If the ref of the environment is not here, this reusable environment will be ignored.


The syntax is just:

reuse: [label_of_reusable_environment]


Saving the environment

In the build process, after every step on every service is checked if there is any reusable environment configuration directive that matches the current position of the build process.

In the case that any config matches, then all the services are paused, then all saved and then unpaused.

Reusing a environment

The reuse label will be checked before start the create process. The reusable environment will be used a the image to pull instead of the specified by the service config.

Later, when building, Qaack will skip all the steps and services until reach the step specified for the reusable environment.

Reusing environment files will be placed over the saved ones, without any file merge mechanisim.


    on: Y.b
      - develop

    on: Z.f
      - develop

reuse: full_site