Jenkinsfile to clone a remote repository

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jenkinsfile to clone a remote repository

Jeeva Chelladhurai
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

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jenkinsfile to clone a remote repository

Antonio Muñiz
You should use https://github.com/jenkinsci/workflow-remote-loader-plugin
to load an external script.

On Thu, Apr 28, 2016 at 11:51 PM, Jeeva Chelladhurai <[hidden email]> wrote:

> 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
>
> --
> 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 [hidden email].
> 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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAJc7kzSYp1oWnSAzr_%2B34mSLdG%2BegNpwyOqmQQz5%3DLOi2vhs3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jenkinsfile to clone a remote repository

Kohsuke Kawaguchi
Administrator
In reply to this post by Jeeva Chelladhurai
What Antonio said, or also see https://www.cloudbees.com/blog/jenkins-workflow-using-global-library-implement-re-usable-function-call-secured-http-endpoint which is a part of the pipeline suite.

On Thu, Apr 28, 2016 at 3:15 PM Jeeva Chelladhurai <[hidden email]> wrote:
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

--
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 [hidden email].
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAN4CQ4w91ySyHGr64PURQHJzcjuE2SzF_%3DBYkfhi-9cN%2Bic8Hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...