How to pass arguments to relativeTo() in copyToSlaveBuildWrapper{}

19 views
Skip to first unread message

eid badr

unread,
Oct 12, 2016, 8:19:18 AM10/12/16
to job-dsl-plugin
Hi

I want to copy files from ${JENKINS_HOME}\userContent\ to the jobs workspace of the slave using copyToSlaveBuildWrapper, I tried different approaches to get relativeTo() to work, but it alway gives me errors.

so how should I pass the relativeTo directory to the method relativeTo() ?

job ("CopyTestFilesToSlaveAndStartTest") {
    label('172.19.146.6')
    wrappers {
      copyToSlaveBuildWrapper {
            // Comma-separated list of patterns of files/directories to be copied.
            includes("testjavadrp*.zip,packages.py,build.xml")
           
            // Specify the base location for the paths that are specified in the Includes and Excludes fields.
            //relativeTo("${JENKINS_HOME}\\userContents")  --> Error (not accepting String only GStringImpl)
            relativeTo()
          }
              
  }

        steps {
                  
               // batchFile("....")
        }
    }

eid badr

unread,
Oct 12, 2016, 9:33:06 AM10/12/16
to job-dsl-plugin
I figured it out

wrappers {
copyToSlaveBuildWrapper {
// Comma-separated list of patterns of files/directories to be copied.
includes("testjavadrp*.zip,packages.py,build.xml")
        excludes("")
flatten(false)
includeAntExcludes(false)
hudsonHomeRelative(false)

// Specify the base location for the paths that are specified in the Includes and Excludes fields.

          //relativeTo(${JENKINS_HOME}+${str})
relativeTo("userContent")
}

}
Reply all
Reply to author
Forward
0 new messages