[workflow-plugin] How to publish to a CIFS share

34 views
Skip to first unread message

Thomas Gimpel

unread,
Sep 5, 2015, 2:11:36 PM9/5/15
to Jenkins Users
Hi,

I want to replace a bunch Jenkins jobs by a single workflow job. This includes a final step which shall publish the artifacts to a CIFS share. Currently I'm using a freestyle job using the Copy Artifact plugin and the Publish over CIFS plugin to fulfill this task. Since there is no direct support for the Publish over CIFS plugin within a workflow yet I tried to trigger the existing publishing job from the workflow script like this:

node('linux') {
    build(
        job: 'Publish_over_CIFS',
        parameters: [
            [
                $class: 'StringParameterValue',
                name: 'BUILD_SELECTOR_ARTIFACTS',
                value: '<SpecificBuildSelector plugin="copyar...@1.35.2">  <buildNumber>' + env.BUILD_NUMBER + '</buildNumber></SpecificBuildSelector>'
            ]
        ]
    );
}

Unfortunately this does not work. The job fails with following error:

/var/lib/jenkins/jobs/Publish_over_CIFS/workspace/.87e38c35/script.sh: line 2: syntax error near unexpected token `<'

However, when I replace the "env.BUILD_NUMBER" by a constant number pointing to an already completed build, then code above works perfectly. It seems that the Copy Artifact plugin has problems accessing the artifacts of the current build.

What is wrong with the code? Or is there a better way to publish artifact to a CIFS share?

Thanks!

Thomas
Reply all
Reply to author
Forward
0 new messages