-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
When running our Jenkins pipeline we sometimes get errors like the one below and there I would like to know what clues the directory path can give me.
/machine01/jenkins_ws/nfs_ws/01/workspace/main-ci-job/path/in/repo@tmp/durable-82d83e2b/script.sh.copy: line 3: cmake: command not found
So in this case we have a CMakeLists.txt file in path/in/repo, but what does @tmp/durable-82d83e2b mean?
- What is @tmp?
- What is durable?
- What is the hash? (it is not a hash known to git)
When you execute a sh step in a pipeline with
node { sh 'cmake ...' }
the sh step will create the directory '@tmp/durable-<hash>/' where it puts temporary files, e.g. the script of the sh step is put there as Jenkins needs to execute the script, so it must exist in the file system somewhere. Without looking into the details the hash is probably based on script content and timestamp to ensure it is unique for the execution of this step.
Once the sh step is finished, the 'durable-<hash>' is deleted.
The '@tmp' is a general temporary directory for the pipeline run where all kinds of steps put temporary files, e.g. withCredentials uses it, once a run is finished this directory still exists but is normally empty