[JIRA] (JENKINS-46582) stash / unstash pipeline step is not preserving files timestamp

3 views
Skip to first unread message

vivek.pandey@gmail.com (JIRA)

unread,
Nov 16, 2018, 12:15:01 PM11/16/18
to jenkinsc...@googlegroups.com
Vivek Pandey updated an issue
 
Jenkins / Bug JENKINS-46582
stash / unstash pipeline step is not preserving files timestamp
Change By: Vivek Pandey
Labels: stash timestamp triaged-2018-11
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

spenser@sima.ai (JIRA)

unread,
Jun 10, 2019, 5:15:02 PM6/10/19
to jenkinsc...@googlegroups.com
Spenser Gilliland commented on Bug JENKINS-46582
 
Re: stash / unstash pipeline step is not preserving files timestamp

Hi, just wanted to say that I'm seeing the same issue.  Please let me know of any workaround for this.

spenser@sima.ai (JIRA)

unread,
Sep 2, 2019, 8:36:02 PM9/2/19
to jenkinsc...@googlegroups.com

Here's a workaround to get good timestamps back and forth.  The --keep-newer-files option is very useful if you need to overwrite your workspace.  

def stash_ws() {
  sh """#!/bin/bash -ex
tar -c --keep-newer-files -f ws.tar --exclude ws.tar --exclude-vcs .
"""
  stash name: 'mystash', includes: 'ws.tar'
}

def unstash_ws() {
  unstash name: 'mystash'
  sh """#!/bin/bash -ex
tar -x --keep-newer-files -f ws.tar
"""
}
Reply all
Reply to author
Forward
0 new messages