Skip to content

Allow user to specify custom build dir for Custom executor

Description

With #2885 (closed) a the generic executor can run scripts/binaries that the user wants which enables the user to define how to provision the infrastructure. Apart from the infrastructure the user might want the ability to define how builds_dir is defined on run time depending on some variables. For example, a user might want the build dir to look something like /builds/$JOB_ID/$CI_USER/$SOME_CUSTOM_VARIABLE which can only be evaluated at runtime.

Proposal

Add a new stage apart from prepare/run/cleanup where the user can define some variables such as BUILD_DIR & CACHE_DIR in a specific format which GitLab Runner will read these and define the builds/cache dir accordingly. The format of this file has not been decided yet, but one idea is to follow the .env format like the docker one.

Links to related issues and merge requests / references

Generic executor introduced in #2885 (closed)

Edited by Tomasz Maczukin