Disable Git Clean between jobs?


#1

Can I disable ‘git clean’ that occurs between jobs?

I want Job1 in stageA to run and then I want Job2 in stageA (or Job2 in stageB) to have access to Job1 extra files (without making them artifacts as I don’t want them past Job2 - think compiled binaries that Job2 packages). GIT_STRATEGY: none doesn’t appear to do the trick.

To work around this I currently just combine the compile and package parts of the CI job into one big job but would like to have two separate jobs for sanity.

Is there a better way to achieve this?

Thinking through this I see this is kinda design problem in my head: Assuming 3 available runners, its entirely possible Job1 runs on Runner1, Job2 could easily run on Runner2, and Job3 could easily run on Runner1. With that in mind is there a better way to separate a compile from a gather step? It’s an msbuild solution, so thats what makes me want to divorce the two parts.


#2

I am trying to do the same thing and I am stuck too …


#3

Try to use the artifacts and dependencies


#4

To hijack this a little.
I would like to avoid the git clean for iteration time of the CI.
My build process takes a VERY long time the first time it runs but incrementally it is much faster.

I would like my daytime runs to be incremental runs so I can push more runs through my build boxes on any given day.
I would like to disable the git clean most of the time but say once an evening run a clean job that does the git clean for me so my nightly builds are running with a clean image.


#5

In addition to that, I have been looking for a way to schedule a set of jobs to run every night in addition to the normal CI stages. I have not been able to find a mechanism to mix in scheduled jobs to the regular CI operations.


#6

Hmmm I missed these:

variables:
GIT_STRATEGY: "none"
GIT_CHECKOUT: “false”

Looks like the solution I was looking for was to simply turn off syncing at all and then
to manually do the sync myself in my build script. The problem I am having is that the script I would want to run to determine if I should clone or pull I have up till now included in my repo. A bit of a chicken vs egg issue.

I would love to see a GIT_STRATEGY: “incremental” that would pull but not clean. Or a GIT_CLEAN_STRATEGY: “nightly/every_sync” or something to support this mechanism automatically. This would support a common build pattern of fast incremental builds during the work day but nightly doing a more expensive, fully clean set of tests using triggers, though I would love to be able to set that up in my pipeline configuration as well!

I couldn’t get syncing via token working so I ended up using username:password.
I pulled the CI token off my pipeline page and
added it to my pull:

https://gitlab-ci-token:ci_token@gitlab.com/user/repo.git

Where ci_token = the token I pulled off the pipeline page. I got auth errors every time I was attempting to clone but replacing that with username:password worked.