Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23308

CopyToSlave: Variables doesn't work in custom workspaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • copy-to-slave-plugin
    • None
    • Jenkins 1.566
      CopyToSlave 1.4.3
      Ubuntu 14.04.

      When using a variable in a custom workspace, it doesn't get replaced for copy-to-slave.

      I see correctly "Building remotely on Jenkins-Worker-01 (Remote-Worker) in workspace /var/lib/jenkins/jobs/a_name/workspace" in the log and "/var/lib/jenkins/jobs/a_name/workspace" is the $PARAMETER. But the copytoslave uses $PARAMETER as a string...
      Interesting point is, it gets resolved correctly for the slave, but not the master.

      How to reproduce:

      • Creating a project with "Use custom workspace: $PARAMETER"
      • Enable "Copy files into the job's workspace before building" with "This job's workspace on the master (not advised)"
      • Start the build with $PARAMETER=/var/lib/jenkins/jobs/a_job/workspace/

      Got:
      [copy-to-slave] Copying '.,*', excluding '/.git/,*/.gitignore', from 'file:/$%7BPARAMETER%7D' on the master to 'file:/var/lib/jenkins/jobs/a_job/workspace/' on 'slave'.

      Expected:
      [copy-to-slave] Copying '.,*', excluding '/.git/,*/.gitignore', from 'file:/var/lib/jenkins/jobs/a_job/workspace/' on the master to 'file:/var/lib/jenkins/jobs/a_job/workspace/' on 'slave'.

            svvivek Vivekanand SV
            kfritsche Karl Fritsche
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: