“Copy artifacts from another project” and Jenkinsfiles are exclusive, correct?

538 views
Skip to first unread message

dandeliondodgeball

unread,
Oct 3, 2017, 6:15:47 PM10/3/17
to Jenkins Users

I discovered the Copy Artifact plugin and was all happy when it worked for me.  But when I went back to my  configuration which makes use of a Jenkinsfile that option wasn’t available.  There is no Build section in the configuration.

 

The first one is a “freestyle” configuration and the other a “pipeline” configuration, maybe?

 

Is there a feature like this available in the Jenkinsfile?

 

Thanks


Robert Hales

unread,
Oct 3, 2017, 11:59:29 PM10/3/17
to Jenkins Users

dandeliondodgeball

unread,
Oct 4, 2017, 12:27:01 PM10/4/17
to Jenkins Users
Helpful, thanks.

So there is only a scripted pipeline solution, no support for declarative, correct?

Robert Hales

unread,
Oct 4, 2017, 1:54:03 PM10/4/17
to Jenkins Users
I don't know of any declarative support, but you can still wrap it in a script{} block in declarative. 

dandeliondodgeball

unread,
Oct 4, 2017, 3:51:09 PM10/4/17
to Jenkins Users
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']
}

Any ideas? Thanks.

dandeliondodgeball

unread,
Oct 5, 2017, 11:20:45 AM10/5/17
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages