Execute script to work on original files from master branch

Hello. It’s good idea to mention that I’m new to GitLab :).

Here’s my problem:

On my master branch I have a folder (named “presets” i.e.) that contains a set of scripts (that is hole point of this repo).
In other I have a folder called “missions” which contains more folders with - guess what - mission files. I.e.:


Now. On each commit I want to update in these folders with files from “presets” folder on each commit with this script:


if [ ! -d MPMissions ]
mkdir MPMissions
mkdir MPMissions/example.tanoa

for each in `ls MPMissions`
find preset.VR | grep -v mission.sqm | while read path
cp -r -u "$path" MPMissions/"$each"

After that just simply clone that repo.

Unfortunately GitLab CI works on clone by default and that clone goes to ether. How to make it work?


It is not clear whether you want your script to run on the GitLab server or on your workstation.

If you want it to run on the GitLab server, you can write a Git hook as described in https://docs.gitlab.com/ee/administration/custom_hooks.html. Please note that this is applicable to self-hosted GitLab installations only, not gitlab.com.