fabric8io / jenkins-pipeline-library

a collection of reusable jenkins pipelines and pipeline functions
Apache License 2.0
275 stars 181 forks source link

work out the github origin url using a function #130

Closed rawlingsj closed 7 years ago

rawlingsj commented 8 years ago

In our Jenkinsfiles we set the remote git origin URL like so https://github.com/fabric8io/fabric8-forge/blob/v2.2.192/Jenkinsfile#L5

It would be better to create a function that does this by using the SCM url - nice idea @rhuss !

Just as an idea: Wouldn’t it be possible to extract this URL from the Job config, too ? So that we could add a function to the global library, like ‘setScmPushUrl’ without any argument. In fact, the Gi URL is currently the only project specific data in the Jenkinsfile. Otherwise it could be completely generic.

rawlingsj commented 8 years ago

I guess when we're in a multi project Jenkinsfile we can't use the Job SCM URL but maybe we can use another way, using the git info?

rajdavies commented 7 years ago

Added function to get push url into Fabric8Commands - https://github.com/fabric8io/fabric8-pipeline-library/commit/643c6f6a9ca5c1f2f9c8e4d063d36ae640bb8a65