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.:

missions/map1.mission1
missions/map1.mission1

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

#!/bin/sh

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

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

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?

Hi,

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.