Trying to use CopyArtifact in declarative pipeline

1,234 views
Skip to first unread message

dandeliondodgeball

unread,
Oct 5, 2017, 11:19:36 AM10/5/17
to Jenkins Users
Original post: https://groups.google.com/forum/#!topic/jenkinsci-users/n1oqnnW1A98

So this worked (scripted)

node {
step ([$class: 'CopyArtifact', projectName: 'Create_Infrastructure_archive']);


This doesn't break, but nothing happens (declarative).  

pipeline {
agent any
stages {
stage('Build') {
steps {
script {
[$class: 'CopyArtifact', projectName: 'Create_Infrastructure_archive']
}

dandeliondodgeball

unread,
Oct 5, 2017, 12:44:38 PM10/5/17
to Jenkins Users
Ok, finally got it.  This worked.

script {

dandeliondodgeball

unread,
Oct 6, 2017, 4:12:20 PM10/6/17
to Jenkins Users
Took me a while to find this, so posting it to make it easier to find.

CopyArtifact syntax (ok, maybe syntax isn't the correct word for this, but you get the idea)

  step ([$class: 'CopyArtifact',

    projectName: "${jobname}",

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

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

    target: '.']);

Jon Schewe

unread,
Oct 7, 2017, 3:40:05 PM10/7/17
to jenkinsci-users
Adding this to the copy artifact plugin page will help others. Those pages are wikis so you can just login with your Jira credentials and edit.

--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/74c47988-5d6d-4afd-9a60-66f2b489ae7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Chris Foran

unread,
Oct 9, 2017, 3:41:50 PM10/9/17
to jenkins...@googlegroups.com
Didn't notice/know that.   I will update that page. Thanks.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/OU8Kzl6CJXk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALpcnoyBzwxCqJgkrg8jR6uDX5_i8Dg6xGhixsqWFwvFPb2gzQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Foran       | Senior Software Engineer
(617) 586-9962 | chris...@3Derm.com 

101 Huntington Ave, 17th Floor
Suite 1300 c/o 3Derm @ BCBSMA
Boston, MA 02199

Reply all
Reply to author
Forward
0 new messages