Help using "pre_clean_script" or "pre_build_script"?

Hello,
My CI generates folders/files which make the next build fail (I get “warning: failed to remove …”) . I found out about the “pre_clean_script” and “pre_build_script” but i’m not able to get that to work and the old files/folders are not being deleted in the git repo after the fetch.

Here is what i have:

vi /etc/gitlab-runner/config.toml
[[runners]]
name = “compilecode”
url = “https://gitlab.xxx.com/
token = “”
executor = “shell”
pre_clean_script = “cd $CI_PROJECT_DIR && git clean -ffdx”
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]

I tried both pre-clone_script and pre_clone_build.

Any help please? and thank you

Hi,

where did you learn about this config attribute?

Cheers,
Michael

@dnsmichi From the gitlab documentation:

https://docs.gitlab.com/runner/configuration/advanced-configuration.html

Hi,

I’ve been there, but I cannot find pre_clean_script … are you referring to cleanup_exec maybe?

Cheers,
Michael