Use instead
checkout scm

It will checkout code from the repository

fredag 9. september 2016 19.15.03 UTC+2 skrev Phil Swenson følgende:
>
> Hi, I have a multi branch pipeline configuration job working fine so 
> far....
>
> However every single repository has exactly the same jenkinsfile except 
> for the git repo name.
>
> a typical jenkinsfile looks like:
>
> node('docker-slave') {
>     withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 
> 'NEXUS', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 
> 'NEXUS_PASSWORD']]) {
>         git url: '[email protected]:myco/myprob.git', branch: 
> env.branch_name, credentialsId: '08df8ab41de0', variable: 'CREDENTIALS'
>         stage 'Test'
>         sh 'env > env.txt'
>         sh 'cat env.txt'
>         sh 'make verify'
>     }
> }
>
>
> What I'd like to do is detect which git repo triggered the build so I don't 
> have to hardcode it in the jenkinsfile.  
>
>
>
> So what I'd like is to change the git line to something like:
>
>
>  git url: *env.GIT_URL*, branch: env.branch_name, credentialsId: 
> '08df8ab41de0', variable: 'CREDENTIALS'
>
>
>
> This gets me closer to my eventual goal of storing my Jenkinsfile in a common 
> location instead of having to copy it repo to repo and modify it repo to repo.
>
>
> Any ideas?
>
>
> Thanks
>
> phil
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0b207773-2ec0-4af3-a95a-6703a711f692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to