Hello Denis,
The working directory will always be cleaned using something like git clean -dff (or git clean -dffx maybe) before any job starts. If you really need something across runs, then you should move it out of the workspace directory. However, please note that this is not recommended. One of the concepts of CI is repeatability. It shouldn’t depend on the environment of a previous run of a job or pipeline.
The GoCD way of keeping state across stages within a pipeline (for instance) is to use artifacts.
Cheers,
Aravind
Hello Denis,
It depends. GoCD just does a git clean as I mentioned, which shouldn’t change modified times of your codebase, I mean, of files which haven’t changed, right?
If you’ve asked it to clean working directory, it will remove and re-clone. Otherwise, it shouldn’t change. Of course, if you have multiple agents, you can’t guarantee that the same agent will pick up your job across days without using GoCD’s job resources.
Cheers,
Aravind
Hello Denis,
It’s hard to say for sure, just from that, but these are some behaviors I believe are true:
git clean. No way to stop that. It will need to make sure every job run starts with a clean slate.
I mean: Suppose you configure the material to check out into folder “src1” and then run your build from the parent dir of “src1”, then git clean should run only within “src1”, leaving your workspace in the parent untouched. It isn’t recommended to depend on something left behind, as I said, but that’s one way that might work in this case, assuming it works for your build system to work that way.
Cheers,
Aravind