[pipeline][parametrized build][Jenkinsfile]Cannot use variable to checkout the parametrized build

183 views
Skip to first unread message

jer...@bodycad.com

unread,
Aug 5, 2016, 2:59:56 PM8/5/16
to Jenkins Users
Hi,

from previous project we were using parametrized build to specify the wanted branch into SCM branch (Mercurial one). It was working like a charm into

Source Code Management
  |x| Mercurial 
            Revision ${BRANCH_NAME}


If I do the same thing for pipeline to checkout the proper Jenkinsfile, this happen:
abort: unknown revision '${BRANCH_NAME}'!

I can specify the branch into the Jenkinsfile but I cannot use this to checkout the proper Jenkinsfile.
checkout scm: [$class: 'MercurialSCM', source: "http://...", browser:[$class: 'HgWeb', url: "http://..."], clean: false, credentialsId: '', revision: "${BRANCH_NAME}", revisionType: "BRANCH"], poll: false

This work, but I also need to checkout the Jenkinsfile from that branch too.

Anybody know of a way to do this?
Thanks
Jerome

jer...@bodycad.com

unread,
Aug 17, 2016, 11:33:00 AM8/17/16
to Jenkins Users
Hi,
Anybody known if this will solved or any workaround? this is the last show stoper for us to move to pipeline. I would really like to get ride of the old project. 

I have attach some screen capture if I wasn't clear enough.

I work around most other problems but this I cannot do much. Unless I use a project direct script that perform a first checkout (checkout scm: [...]) with the branch then append the repos Jenkinsfile to the current script execution if that's even possible???

Thanks,
Jerome
PipelineJenkinsfile.PNG
Parameter.PNG
Reply all
Reply to author
Forward
0 new messages