Syntax for multiple artefact patterns in a declarative script?

34 views
Skip to first unread message

David Aldrich

unread,
Mar 5, 2018, 5:34:47 AM3/5/18
to jenkins...@googlegroups.com

Hi

 

I want to specify two artefact patterns in a declarative script but am unsure of the syntax:

 

post {

     always {

             archiveArtifacts artifacts:'myProj/myExe',artifacts:'../solibs/myLib'

            }

     }

}

 

Errors encountered validating Jenkinsfile:

WorkflowScript: 71: Duplicate named parameter 'artifacts' found.

 

What is the correct syntax please?

 

Best regards

 

David

 

Victor Martinez

unread,
Mar 5, 2018, 5:52:45 AM3/5/18
to Jenkins Users
You need to use comma separated based, further details in the <YOUR_JENKINS_URL>/pipeline-syntax/ and https://jenkins.io/doc/pipeline/steps/core/#archiveartifacts-archive-the-artifacts 

Something like the above snippet should work

             archiveArtifacts artifacts:'myProj/myExe, ../solibs/myLib'



Cheers


David Aldrich

unread,
Mar 5, 2018, 6:15:21 AM3/5/18
to jenkins...@googlegroups.com

Thank you, that fixed it.

 

archiveArtifacts artifacts:'myProj/myExe, solibs/*.so'

 

Best regards

 

David

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/57fd33c9-2dda-4348-83be-bb25e47902c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.

Reply all
Reply to author
Forward
0 new messages