I am using this as a way of getting transient archiving for now:
def work = 'tmp/'
try {
node {
dir(work) {
git url: '[email protected]:zanata/zanata-parent.git'
sh 'ls -l'
}
archive work
}
node {
sh 'rm -rf -- *'
unarchive mapping: [(work) : '.']
dir(work) {
sh 'ls -l'
archive '**/pom.xml,**/target/*.jar,**/target/*.war'
}
}
} finally {
node('master') {
//def buildNumber = System.getenv()['BUILD_NUMBER']
sh "rm -rf -- ../builds/*/archive/$work"
}
}
I would greatly prefer to delete archive/$work from the current build only
(instead of builds/*), but I don't know how to access the build number from
the workflow, or whether that even makes sense in a workflow.
If anyone has other ideas or suggestions, please let me know!
On 12 December 2014 at 13:12, Sean Flanigan <[email protected]> wrote:
> With the workflow plugin, what's a good way of sharing the workspace from
> one node to another?
>
> The only example I have found is this:
> https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#multiple-threads
>
> It uses
>
> archive 'pom.xml, src/'
>
> on the first node, followed by
>
> sh 'rm -rf *'
> unarchive mapping: ['pom.xml' : '.', 'src/' : '.']
>
> on the second node. That should work, but I don't want to explicitly
> enumerate the files and directories in my workspace, and also I don't want
> to leave these files clogging up the archive system after the workflow has
> finished.
>
> If I put the git repo in a subdirectory and archive/unarchive that, it
> should solve the enumeration problem, but it still leaves me with the disk
> space problem. Is there some sort of transient archiving feature I could
> use?
>
> Alternatively, if I clone the same git repo to both nodes, how can I
> ensure that they both check out the same git revision?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/2f2da7e6-23d1-4ca1-bfda-3cef70b8ebfa%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/2f2da7e6-23d1-4ca1-bfda-3cef70b8ebfa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAGi586M-o35_39rMzWgtAzRgWzfSYG5e80LU6ZRffiVGYd5WYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.