[workflow] Specify BuildSelector for CopyArtifact... syntax please

357 views
Skip to first unread message

Timothy Wojtaszek

unread,
Mar 29, 2015, 3:18:36 PM3/29/15
to jenkins...@googlegroups.com
I have this:

  step ([$class: 'CopyArtifact',

    projectName: "${jobname}",

    filter: "dist/${platform}/${targets}",

    selector: [[ $class: 'SpecificBuildSelector'], buildNumber: 33],

    target: '.']);

But get the error:

script1427656475248993370172.groovy: 7: Unexpected node type: EXPR found when expecting type: LABELED_ARG at line: 7 column: 16. File: script1427656475248993370172.groovy @ line 7, column 16.
       selector: [[ $class: 'SpecificBuildSelector'], buildNumber: 33]]);

It does not like 'selector'.  I got the 'selector' from the job config using a freestyle project:

    <hudson.plugins.copyartifact.CopyArtifact plugin="copyar...@1.35">

      <project>build</project>

      <filter>dist/*</filter>

      <target></target>

      <excludes></excludes>

      <selector class="hudson.plugins.copyartifact.SpecificBuildSelector">

        <buildNumber>12</buildNumber>

      </selector>

      <doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>

    </hudson.plugins.copyartifact.CopyArtifact>

Advice?

Also, it would be great to know how these parameters map from a job to a workflow command.   Looking through the plugin source doesn't seem to really help, and I though the job xml was a sure bet, but that isn't working out so well with this.

Thanks,

tim

Timothy Wojtaszek

unread,
Mar 29, 2015, 3:33:46 PM3/29/15
to jenkins...@googlegroups.com
I think i found it, to many brackets!

    selector: [ $class: 'SpecificBuildSelector', buildNumber: 33],

Reply all
Reply to author
Forward
0 new messages