We have 12 different projects inside the same repository and have a different job to run for each of these.
I want to know how I can trigger a job only when a change has happened in a specific folder, since running all 12 on every push takes too long to finish.
Well I have hacked a solution that works for us.
First, add an
Execute Shell
Build Step:Here:
api
andobjects
are the 2 directories I want to trigger this Jobdevelop
is the main branch we use, so I want to know how my directories compare to that branch in particular$WORKSPACE/RUN_TEST
to set a variable if I should or not run itThen in the time-consuming build steps add:
That way the job is triggered but runs as fast as if it wasn't triggered.
Now I modified it to:
And set
Exit code to set build unstable
to111
on all build steps. Then, in all following build steps I did: