Copy To Slave Plugin

This plugin allows to copy a set of files, from a location somewhere on the master node, to jobs' workspaces. It also allows to copy files back from the workspaces of jobs located on a slave node to their workspaces on the master one.

New homepage
The plug-in is being maintained by its owner/maintainers from  a new home. The plug-in is still compatible with Hudson, however, the entry points for documentation and issue reporting have been combined in order to provide a single point of entry.

Plugin Information

Plugin ID copy-to-slave
Latest Release 1.4.1-h-1
Latest Release Date Dec 17, 2012
Sources Github
Support Eclipse Hudson Forum
Issue Tracking Eclipse Bugzilla

Labels:

plugin-slaves plugin-slaves Delete
plugin-notifier plugin-notifier Delete
tier3-compat-plugin tier3-compat-plugin Delete
plugin-buildwrapper plugin-buildwrapper Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Mar 09, 2010

    Mark Miller says:

    I need a little help (more information) to get this plug-in working.  I hav...

    I need a little help (more information) to get this plug-in working.  I have two machines, an AIX Hudson master and a Windows machine running XP as the Hudson slave.  The slave agent is installed as a service.  It works great. I actually have the slave machine building my Java docs.  So the setup works, but I am unable to copy any files from the master machine to slave using this plug-in.   Here's what I do:

    1. Create new job.
    2. No source control, because I'm just testing file copy.
    3. Tie job to slave node.
    4. Click on "Copy files to slave node before building"

    Step 4 is when I start running into trouble.  When I specify "/test/build.xml" the edit box complains it can't find the file.  I've verified the file exists.  I even copy-pasted the path from the console window to make sure it's not a typo.  Hudson edit box says it can't find the file.  Ok, fine, I ignore it and run the job anyway.  The job reports success... but there is no file copied over, and I don't see anything in the job console output showing a file being copied over, but the plug-in also doesn't complain that it's not finding any files.  I'm using plug-in 1.2.  I'm using Hudson 1.348.

    The help text for each option is confusing.  The help says:

    "When a build takes place on a slave node, copies a set of files from the master node to this slave node. This is useful, for example, when some files required for the build to take place are not present in the SCM and are located direclty in the project's workspace.
    Of course, no copy will take place if the build is run on the master node."

    "Comma- or space-separated list of patterns of files/directories to be copied from the master node to the slave one. See the @includes of Ant fileset for the exact format. The base directory is the workspace.
    E.g.: *.xml,*/.properties"

    The part that's confusing me is that when a job is tied to a slave node the "workspace" is now on the slave machine, not local to the master, so any file paths using the workspace as the base wouldn't work since the files I need to copy aren't on the slave, obviously.  I'm thinking this is just bad text, or maybe I'm missing something obvious about the wording.

    So here is what I do know. 

    1. The file copy edit box reports it can't find the file specified, even though I copy pasted the path and the file exists on the master machine.
    2. The job runs successfully but there is no output in the console showing a file being copied.
    3. The job runs successfully but there is no output showing that the plug-in did not find the file specified.

    If you could provide any insight as to what I'm doing wrong I'd really appreciate it.  I've systematically tried just about everything I can think of and have been completely unsuccessful at getting the plug-in to work for me.

    I appreciate the help.

      Mark

    1. Mar 09, 2010

      Vincent Latombe says:

      I agree with the previous comment, I have no clue about where the files to copy ...

      I agree with the previous comment, I have no clue about where the files to copy to the slave are taken from.

    2. Mar 10, 2010

      Romain Seguy says:

      When you activate this plugin for job A, then the Files to copy field is expecte...

      When you activate this plugin for job A, then the Files to copy field is expected to contain a set of folders/files that are relative to the workspace of the job (there is a link in to this workspace in the inline help), that is, that are relative to the folder <HUDSON_HOME>/jobs/A/workspace (as of Hudson 1.312). E.g., if the files to copy are named *.xml and are located in <HUDSON_HOME>/commonFiles, then the field must be set to ../../../commonFiles/*.xml.

      Structure of a Hudson master node as of Hudson 1.312
      <Hudson master home>
        +- jobs
        |  +- A
        |     +- workspace
        |        +- <content of the workspace on the master>
        +- ...
      
      Structure of a Hudson slave node as of Hudson 1.312
      <Hudson slave home>
        +- workspace
        |  +- A
        |     +- <content of the workspace on the slave>
        +- maven2.1-interceptor.jar
        +- maven-agent.jar
        +- maven-interceptor.jar
        +- slave.jar
      
      1. Mar 10, 2010

        Vincent Latombe says:

        Hello, thanks for the precisions, I have been able to copy a file that sits in t...

        Hello,
        thanks for the precisions, I have been able to copy a file that sits in the workspace. However, couldn't manage to copy an xml file that is inside HUDSON_HOME. In my case, I've tried using ../../../clean.xml (the file sits in HUDSON_HOME) and it doesn't seem to be copied to the slave.

        Furthermore, even when it works, it could be useful to get a log of what was copied (at least the number of files). Currently, I get nothing in the output.

        1. Mar 10, 2010

          Romain Seguy says:

          Try to manually create the workspace folder on the master, it should help I thin...

          Try to manually create the workspace folder on the master, it should help I think. For the next release I will add the creation of the workspace to avoid this pbm.
          The plugin has some logging capabilities, you need to set the log level to FINEST.

          1. Mar 10, 2010

            Vincent Latombe says:

            Ok, I now have the logs, but I still cannot reference any file that is in parent...

            Ok, I now have the logs, but I still cannot reference any file that is in parent directories. Thanks for the help anyway.

            1. Mar 10, 2010

              Romain Seguy says:

              That's weird... May you send me the details of you config (Hudson version and jo...

              That's weird... May you send me the details of you config (Hudson version and job's config.xml) on my mail so that I can investigate on that?

              1. Apr 21, 2010

                Carl Quinn says:

                I am using Hudson 1.353 and the latest version 1.2 of this plugin and I also see...

                I am using Hudson 1.353 and the latest version 1.2 of this plugin and I also see a failure in its ability to get to files above the jobs workspace. Even with the workspace manually created.

                Is it possible that Hudson core is preventing it from accessing files above the workspace? Or maybe this plugin is somehow being executed on the slave and not the master?

                I am trying to use this plugin to push a build artifact from one job built on a local slave, to another job that builds on an EC2 instance which doesn't have access to our network. This plugin seemed like just the right tool to do the push...

                1. Nov 11, 2010

                  Romain Seguy says:

                  The 1.2.2 release adds a new option which allows specifying the files relatively...

                  The 1.2.2 release adds a new option which allows specifying the files relatively to HUDSON_HOME rather than the workspace. HTH.

  2. Mar 16, 2010

    Gabriel Baez says:

    It would be awesome if this  plugin  cloned the work  space ...

    It would be awesome if this  plugin  cloned the work  space  from the master to a slave for building.  

    For example in my  environment we cant install  clearcase on linux machines and there are some applications that need to be build  from  a linux environment.   My hudson install it's  on a windows server,  if I could checkout the code from the windows hudson  and then send that to the slave that would be great!

    1. Mar 16, 2010

      Romain Seguy says:

      You should take a look at the Clone Workspace SCM Plugin for that.

      You should take a look at the Clone Workspace SCM Plugin for that.

  3. May 12, 2010

    Glen Accardo says:

    I'm having exactly the same issue as Vincent Latombe.  I can specify *&...

    I'm having exactly the same issue as Vincent Latombe.  I can specify ** as the files to copy to the slave, and get every
    file in the workspace.  However, if I specify "../**" or any relative path, I get nothing.  I'm running Hudson 1.355 on a
    Windows 2003 system.

    Any assistance resolving this issue would be appreciated.

    1. May 20, 2010

      Romain Seguy says:

      Kindly open an issue in JIRA for that an assign it to the proper component (you ...

      Kindly open an issue in JIRA for that an assign it to the proper component (you may need to request through the dev mailing list for the copy-to-slave component to be created, I don't think it's been created yet).

      1. Jul 19, 2010

        Fred G says:

        I opened a bug for this: http://issues.hudson-ci.org/browse/HUDSON-7021 Please ...

        I opened a bug for this: http://issues.hudson-ci.org/browse/HUDSON-7021

        Please vote for it.

        1. Nov 11, 2010

          Romain Seguy says:

          Fixed in 1.2.2: It adds a new option which allows specifying the files relative...

          Fixed in 1.2.2: It adds a new option which allows specifying the files relatively to HUDSON_HOME rather than the workspace.

  4. Nov 29, 2010

    kdszh says:

    Hi all:   what's the execution order between copy-to-slave and gr...

    Hi all:

      what's the execution order between copy-to-slave and groovyo-postbuild plugin ?

      I want to run copy-to-slave first,then groovy-postbuild ,but since I install groovy-postbuild plugin ,then install copy-to-slave plugin ,Hudson always run groovy-postbuild first.

      somebody help me ? :(

      Hudson version: 1.383

      copy-to-slave: 1.2

      groovy-postbuild: 1.3

    1. Nov 30, 2010

      Romain Seguy says:

      Hi, What is your exact requirement? I guess that your need it to process the fi...

      Hi,

      What is your exact requirement? I guess that your need it to process the file(s) that the build has produced using some Groovy stuff. If yes, couldn't you do it on the slave side before using the "Copy back to master" option?

      I ask that because the order of the execution of the plugins can't be guaranteed unless some special care is taken at the source code level. But, I won't implement that in the copy-to-slave plugin since the requirements will never be the same depending on users.

  5. Dec 02, 2010

    Hendryk Bockelmann says:

    Hey you, I want to use this pretty cool plugin to copy some generally needed scr...

    Hey you, I want to use this pretty cool plugin to copy some generally needed scripts from master to several slaves.

    The files are located in $HUDSON_HOME/userContent/* and the upload to slaves work quite good (at least on my Linux slaves ... there are some problems on AIX slaves btw).

    What I now see is that on the slaves the files get copies to $WORKSPACE and the relative path from the master is preserved, ie. on the slave a new directory userContent is created. I think it would be a fine option for the plugin to be able to set the path on the slave (relative to $WORKSPACE) within the job configuration.

    1. Dec 02, 2010

      Romain Seguy says:

      Hi Hendrik, I understand your need, but it raises a question (which is why I di...

      Hi Hendrik,

      I understand your need, but it raises a question (which is why I didn't implement such a functionality yet): How the handling of several different paths to copy (e.g. userContent/*/, myScripts/*/) would be done? In case you copy just one folder, then ok, it can be easily implemented in the plugin by adding some kind of a mv command. But in case of several folders, that's far more complicated than that.
      What about having a "flatten" option which would just, well, flatten everything in the workspace directory?

      1. Dec 02, 2010

        Hendryk Bockelmann says:

        Hey Romain, thanx for quick response. imho it would be a nice option if I could ...

        Hey Romain, thanx for quick response. imho it would be a nice option if I could set a "flatten" flag that ensures all files from different directories on master to be copied directly into $WORKSPACE of the slave.

        Maybe there could be a dropdown-menu which says: 'keep directory structure of master' or 'copy all files to $WORKPACE'

        1. Dec 02, 2010

          Romain Seguy says:

          Ok, let's go for the "flatten" option. Please open an issue in the JIRA issue tr...

          Ok, let's go for the "flatten" option. Please open an issue in the JIRA issue tracker, it'll be automatically assigned to myself and I'll be sure to not lose track of it (as I won't do it today).

  6. Dec 23, 2010

    Patrick Renaud says:

    This plugin is interesting. However, in the case of a maven2 project I noticed i...

    This plugin is interesting. However, in the case of a maven2 project I noticed it runs after the pre-build steps, which is too late for what I would need it to. Is there a way to bump its execution order to occur before the pre-build steps?

    1. Jan 02, 2011

      Romain Seguy says:

      I'm afraid the answer is no...

      I'm afraid the answer is no...

      1. Jan 04, 2011

        Patrick Renaud says:

        Hi Romain, But you do realize that it makes this plugin rather useless for mave...

        Hi Romain,

        But you do realize that it makes this plugin rather useless for maven2 jobs, do you? Or should it say: it makes it useless for maven2 jobs who need the files copied by the plugin during the pre-build steps.

        If it is really impossible to run the plugin before the maven pre-build steps as you indicated, would you be able to suggest an alternate path to do what I need to do? In essence, the pre-build step need to run on files copied by the copy-to-slave plugin (thus files purposely not in SCM). Otherwise, it seems that my only choice is to abandon using this plugin, and that would not be my first choice. This is a nice plugin that fits well in a build process, but executing at the wrong time.

        1. Jan 05, 2011

          Romain Seguy says:

          Hi Patrick, One first thing, can you confirm I'm right if I say that what bring...

          Hi Patrick,

          One first thing, can you confirm I'm right if I say that what brings pre- and post-build steps to your Maven jobs is the M2 Extra Steps Plugin? I'll assume the answer is yes.

          This plugin adds pre-build steps by using the notion of build wrapper. The Copy To Slave plugin does exactly the same. The bad point with build wrappers is that there's currently no way to control the order in which they are executed (although this could actually be done by altering the behavior of Hudson core). That's why my answer is no, and that's also why versions 1.0 and 1.1 of the plugin were purposely not usable for Maven jobs.

          1. Jan 06, 2011

            Patrick Renaud says:

            Salut Romain, OK, now I understand! Tx very much for the explanation. Is it...

            Salut Romain,

            OK, now I understand! Tx very much for the explanation. Is it in your plans to upgrade the plugin eventually so we could use it for maven jobs that way? No rush, just asking...

            Tx again!

            1. Jan 07, 2011

              Romain Seguy says:

              I'm not a Maven user + Hudson is currently under heavy changes with the move to ...

              I'm not a Maven user + Hudson is currently under heavy changes with the move to Maven 3, so I don't feel I can do this by myself.

  7. Feb 26, 2011

    Raghuram Arakalgud says:

    Hi, Thanks for this wonderful plugin. Is there an ETA for Version 1.2.4 release?...

    Hi,
    Thanks for this wonderful plugin.
    Is there an ETA for Version 1.2.4 release?

    Thanks,