How to prevent RTC from clearing jenkins workspace prior to a build
Trying to switch to using more declarative pipeline jobs in jenkins. Hit an issue where it seems for every build, the workspace is deleted upon job starting (during the fetch stage).
This appears to work just fine when the jenkins job is configured with a pipeline script that is copy/pasted into the jenkins UI. However, when I try to load the pipeline script from SCM, using the load from Repository workspace option, the workspace is deleted completely prior to the fetch.
Note, checking the lightweight checkout has no effect.
There are two fetch stages, the first fetches on master from the repository workspace the jenkins file, and the jenkinsfile has a build definition that forces a fetch on the jenkins node. After the first fetch the files on the node are still there. it appears during the second fetch stage the workspace is first deleted.
The option to "Delete Before Load" is NOT checked in the build definition. As stated above, the exact same jenkins file works when directly copied into the jenkins UI. Only when loading from SCM do I hit this case. I've only tried loading from workspace, not loading from build definition or stream yet.
Of course, the jenkins file also does not have any steps to run cleanWs or anything as well.
It appears the directory is actually deleted, not just some sort of a deletion of generated files, as if I have a shell open in the workspace directory, I get the stale handle issue.
Jenkins 2.263.4
Team Concert Jenkins Plugin 2.2.0
RTC v6.0.6.1
and
Accepted answer
Lakshmi's suggestion to use
agent {
options {skipDefaultCheckout(true)}
}
as discussed here is a good enough workaround for me.
Comments
One other answer
RTC 2.2 is no longer supported. The Jenkins plugin for that is likely no longer supported either. Or are you referring to the RTC Jenkins Plugin?
For supported and current versions of RTC, are you aware of: https://jazz.net/library/article/92827 and articles in general?
Comments
Brett Waldo
Feb 24 '21, 11:45 p.m.Brett Waldo
Feb 24 '21, 11:56 p.m.Brett Waldo
Feb 25 '21, 2:19 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Feb 25 '21, 2:43 a.m.Brett Waldo
Feb 25 '21, 7:49 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Feb 26 '21, 2:07 a.m.Lakshmi Narasimhan T V
JAZZ DEVELOPER Feb 26 '21, 10:26 a.m.1 vote
Brett Waldo
Feb 26 '21, 11:23 a.m.