I wonder if it is possible to perform some operations before the repository is cloned. Indeed, as far as I know, gitlab-ci runner first action is to clone the repository to be built before any script can execute.
My problem:
- To build my project (let's call it my plugin) I need to clone another specific repository, let's call it workspace, and then I need to perform some operations to configure this workspace (using cmake).
- Once done, I need to put my project into a specific subfolder of the workspace, for instance in workspace folder/plugins/my plugin.
- Then I just have to configure my plugin (using cmake) and build/test (using different make commands).
The intuitive way to do that would be to be able to perform early operations before my plugin is cloned by the runner. For instance something like:
- cd builds/namespace/my plugin
- git clone "git address of workspace"
- cd workspace && cmake . -D"some definitions"
- cd plugins
=> from here the clone / build / test can proceed as usual.
I know there is the before_script action, but it is performed after clone.
I also see that there is the pre_clone_script option in the [[runner]] section of the global config.toml file of a runner and I wonder if I can use it for this. Unfortunately, it would imply that all projects will run this script what is certainly not a good idea...
Well If anyone has a suggestion, or better a nice solution to this problem, I would greatly appreciate !