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: 'g...@bitbucket.org: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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5654e752-80b3-4c83-a6e8-597f411b082e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to