Delete build directories

Hi,

how can I configure my gitlab-runner to delete the build directory?
After an successful / unsucessful run there a folders with files from my project.
I want to make sure that there no old files available

Depends on what way you are running the jobs. If you are using Docker, it will run every build in a new container, so it will be isolated by default.

A partial solution would be to do ‘rm -rf *’ in the after_script block of your job. Haven’t done it myself; the runner cleans the folder the next time it’s used (might be the initial git checkout/clone step that does it).

You can set some kind of expiry date after which the files will be auto deleted.