[JIRA] [copy-to-slave-plugin] (JENKINS-28386) Workflow support for Copy to Slave plugin

6 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
May 13, 2015, 3:24:04 PM5/13/15
to jenkinsc...@googlegroups.com
Jesse Glick created an issue
 
Jenkins / New Feature JENKINS-28386
Workflow support for Copy to Slave plugin
Issue Type: New Feature New Feature
Assignee: Vivekanand SV
Components: copy-to-slave-plugin
Created: 13/May/15 7:23 PM
Labels: workflow
Priority: Major Major
Reporter: Jesse Glick

CopyToSlaveBuildWrapper looks like it could be made compatible with Workflow (implement SimpleBuildWrapper) without major refactoring. (Unclear to me why this is a BuildWrapper rather than a Builder.) Similarly, CopyToMasterNotifier could be made to implement SimpleBuildStep. (Again unclear why this is a Publisher rather than a Builder.)

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

scm_issue_link@java.net (JIRA)

unread,
May 13, 2015, 3:25:01 PM5/13/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Sep 8, 2015, 1:11:01 PM9/8/15
to jenkinsc...@googlegroups.com

Probable workaround (untested):

node('master') {
  dir('/path/on/master/1') {
    stash 'master-stuff'
  }
}
node('slave') {
  dir('/path/on/slave/1') {
    unstash 'master-stuff'
  }
  dir('/path/on/slave/2') {
    stash 'slave-stuff'
  }
}
node('master') {
  dir('/path/on/master/2') {
    unstash 'slave-stuff'
  }
}

Note that this requires an executor on the master. Which is probably a good thing: in a secured Jenkins instance, there should be none, which would prevent someone from abusing this system to steal secrets from the master.

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:00:01 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney commented on New Feature JENKINS-28386

Thanks Jesse Glick, that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to run an {{sh "ln -sf $

{env.JENKINS_HOME}

/userContent .}} first and then you can stash includes: "userContent/foo", name: "foo"

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:01:02 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to run an

{{sh "ln -sf $
\ {env.JENKINS_HOME \ }/userContent .}}

first, and then you can


{{stash includes: "userContent/foo", name: "foo"}}

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:01:07 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to run an

{{sh "ln -sf ${env.JENKINS_HOME}/userContent .}}

first , and then you can

{{stash includes: "userContent/foo", name: "foo"}} :)

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:02:03 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to run an

{{sh "ln -sf $\{env.JENKINS_HOME\}/userContent .
"
}}

first, and then you can


{{stash includes: "userContent/foo", name: "foo"}}

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:04:02 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to do something like this:

{code}
node('master') {
  sh "ln -sf $
\ {env.JENKINS_HOME \ }/userContent ."
  stash includes: "userContent/foo/*", name: "master-stuff"
}
node('slave') {
  unstash 'master-stuff"
  sh "ls userContent/foo"
}
{code}

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:04:02 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to do something like this:


{code :groovy }

node('master') {
  sh "ln -sf $\{env.JENKINS_HOME\}/userContent ."
  stash includes: "userContent/foo/*", name: "master-stuff"
}
node('slave') {
  unstash 'master-stuff"
  sh "ls userContent/foo"
}
{code}

mcrooney@java.net (JIRA)

unread,
Oct 6, 2016, 4:04:02 PM10/6/16
to jenkinsc...@googlegroups.com
mcrooney edited a comment on New Feature JENKINS-28386
Thanks [~jglick], that is a great work-around! It almost seems like Pipeline has this feature natively and perhaps this plugin support isn't needed? I couldn't seem to get it to stash something outside of the workspace (either by putting absolute paths or relative ../../ paths), and copy-to-slave prefers to copy things from userContent, so the work-around for me was to run an do something like this:


{ code:groovy}
node('master')
{
sh "ln -sf $\{env.JENKINS_HOME\}/userContent ." }}

first, and then you can

{{ stash includes: "userContent/foo /* ", name: " master-stuff"

}
node('slave') {
  unstash 'master-stuff"
  sh "ls userContent/
foo"
}
{code
}

jglick@cloudbees.com (JIRA)

unread,
Oct 7, 2016, 4:40:03 PM10/7/16
to jenkinsc...@googlegroups.com

I will not offer advice on anything that involves nonzero master executors, which is inherently dangerous and unsupportable.

mcrooney@java.net (JIRA)

unread,
Oct 8, 2016, 4:03:02 PM10/8/16
to jenkinsc...@googlegroups.com
mcrooney commented on New Feature JENKINS-28386

That makes sense for public Jenkins; I don't see anything inherently dangerous about this in a Jenkins with authentication inside an intranet/VPC (though I agree it is less secure). Regardless, you can also accomplish a similar thing by running a separate agent on the master with a different user or in a container, and thus having the unix security model to isolate things as desired. This would allow you to Stash world-readable files on the master without exposing secrets, unless there are other concerns I'm not aware of, which I fully admit there might be.

jglick@cloudbees.com (JIRA)

unread,
Oct 10, 2016, 11:28:06 AM10/10/16
to jenkinsc...@googlegroups.com

This would allow you to Stash world-readable files on the master without exposing secrets

Basically $JENKINS_HOME should not be readable to other users.

jbijota@redhat.com (JIRA)

unread,
Apr 21, 2020, 4:00:03 AM4/21/20
to jenkinsc...@googlegroups.com

Hi Vivekanand SV, is there any update about this issue?

Thanks,

Jan

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages