Score:0

Jenkins: Difference between job and workspace/job?

cn flag

In most recent version of Jenkins on centos 7.9, what is the difference between /var/lib/jenkins/jobs/ and /var/lib/jenkins/workspace/?

They both look like they house the same thing (artifact of a build), but is the former more for archival, while the latter is the workspace that's currently being worked on? I appreciate any help to understand this.

Score:0
us flag

The jobs directory is the place where Jenkins stores the job definitions, build artefacts and build logs.

Workspace is the directory that is used to create the build. One can choose which files to store as build artefacts in the job configuration.

Workspace can be considered as a temporary location for doing build stuff. It can be automatically cleaned before / after build if so desired. However, when a git repository is used as basis for build, cleaning up workspace causes full download of repository whenever build is created. Therefore full cleanup of workspace is not always a good thing.

Hope this clarifies the concepts.

ba flag
Just to add, workspace will also exist on nodes (aka slaves) where agents are running, but the logs (and artifacts if archiveArtifats enabled) are copied back to the sever into the jobs/.../builds directory, post-build. Best practice is not to build on controller (master).The workspace should be considered emphemeral.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.