[JIRA] (JENKINS-60634) Define WORKSPACE_TMP=.../workspace/jobname@tmp

15 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
Jan 3, 2020, 2:51:02 PM1/3/20
to jenkinsc...@googlegroups.com
Jesse Glick created an issue
 
Jenkins / Improvement JENKINS-60634
Define WORKSPACE_TMP=.../workspace/jobname@tmp
Issue Type: Improvement Improvement
Assignee: Jesse Glick
Components: core, workflow-durable-task-step-plugin
Created: 2020-01-03 19:50
Priority: Minor Minor
Reporter: Jesse Glick

WorkspaceList.createTempDir (JENKINS-27152) is used by various plugins, and from Pipeline builds you can even use pwd tmp: true to use this location for custom purposes, but this is awkward. In practice many scripts wind up just binding this to a variable (example). We should define it out of the box.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Jan 3, 2020, 2:52:01 PM1/3/20
to jenkinsc...@googlegroups.com
Jesse Glick started work on Improvement JENKINS-60634
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Jan 3, 2020, 3:02:02 PM1/3/20
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
{{WorkspaceList.createTempDir}} (JENKINS-27152) is used by various plugins, and from Pipeline builds you can even use {{pwd tmp: true}} to use this location for custom purposes, but this is awkward. In practice many scripts wind up just binding this to a variable ([example|https://github.com/jenkinsci/kubernetes-plugin/blob/281d296f9a5945094a59b0f6f7362cbceede762a/Jenkinsfile#L10]). We should define it out of the box.

{{$WORKSPACE}} is used for the main workspace (though not frequently needed as this is also the default working directory). {{$WORKSPACE_TMP}} seems like an intuitive name for the new property and matches the style of the {{@tmp}} suffix. [Standard practice in Linux|https://en.wikipedia.org/wiki/TMPDIR] is to allow {{$TMPDIR}} to define a temporary directory, but using this variable name would result in a behavioral change for some existing scripts that may be unwanted, for example if {{/tmp}} is a RAM filesystem while the Jenkins workspace is persistent; we would like to offer a facility that users can opt in to where it makes sense (for example for project-specific caches) but not where it does not make sense (temporary files that are soon after deleted).

jglick@cloudbees.com (JIRA)

unread,
Jan 3, 2020, 3:27:03 PM1/3/20
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Jan 15, 2020, 7:09:20 AM1/15/20
to jenkinsc...@googlegroups.com
Change By: Oleg Nenashev
Status: In Review Resolved
Resolution: Fixed
Released As: Jenkins 2.214

jglick@cloudbees.com (JIRA)

unread,
Jan 15, 2020, 8:18:07 AM1/15/20
to jenkinsc...@googlegroups.com
Jesse Glick commented on Improvement JENKINS-60634
 
Re: Define WORKSPACE_TMP=.../workspace/jobname@tmp

Resolved in core for freestyle and similar builds; PR remains open for Pipeline.

jglick@cloudbees.com (JIRA)

unread,
Jan 15, 2020, 8:18:07 AM1/15/20
to jenkinsc...@googlegroups.com
Change By: Jesse Glick
Resolution: Fixed
Status: Resolved In Review

jglick@cloudbees.com (JIRA)

unread,
Jan 30, 2020, 4:19:03 PM1/30/20
to jenkinsc...@googlegroups.com
Change By: Jesse Glick
Status: In Review Fixed but Unreleased
Resolution: Fixed
Released As: Jenkins 2.214 , workflow-durable-task-step 2.36
Reply all
Reply to author
Forward
0 new messages