Jenkinsfile to clone a remote repository

3,112 views
Skip to first unread message

Jeeva Chelladhurai

unread,
Apr 28, 2016, 5:51:37 PM4/28/16
to Jenkins Users
Hello All,

I am planning to organize my source code in one github repository, and the Jenkinsfile and the configuration/topology file in a different github repository.. Would it be possible to clone/check out the remote repository using my Jenkinsfile? I tried something as show below but it does not seem to be working... Your help is greatly appreciated ..

node ('docker') {
    stage
"SCM Synch"
    checkout scm

    stage
"Main Src"
    git url
: 'https://github.com/<id>/<repo>.git'
    checkout scm

    stage
"Next Stage"
    sh
"echo yet to write"
   
}



Thanks,
Jeeva

Antonio Muñiz

unread,
Apr 29, 2016, 4:59:15 AM4/29/16
to jenkins...@googlegroups.com
You should use https://github.com/jenkinsci/workflow-remote-loader-plugin
to load an external script.
> --
> 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/46730175-e8d4-4d68-aadf-16fb3e170ea7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Antonio Muñiz
Software Engineer
CloudBees, Inc.

Kohsuke Kawaguchi

unread,
Apr 29, 2016, 12:12:42 PM4/29/16
to jenkins...@googlegroups.com
--
Reply all
Reply to author
Forward
0 new messages