1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Merge pull request #30 from marcusholl/pr/removeGetGitCoordinates

Remove Utils#retrieveGitCoordinates
This commit is contained in:
Alejandra Ferreiro Vidal 2017-12-05 14:15:10 +01:00 committed by GitHub
commit 98a08968af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,23 +15,3 @@ def getMandatoryParameter(Map map, paramName, defaultValue) {
return paramValue
}
def retrieveGitCoordinates(script){
def gitUrl = script.params.GIT_URL
def gitBranch = script.params.GIT_BRANCH
if(!gitUrl && !gitBranch) {
echo "[INFO] Parameters 'GIT_URL' and 'GIT_BRANCH' not set in Jenkins job configuration. Assuming application to be built is contained in the same repository as this Jenkinsfile."
gitUrl = scm.userRemoteConfigs[0].url
gitBranch = scm.branches[0].name
}
else if(!gitBranch) {
error "Parameter 'GIT_BRANCH' not set in Jenkins job configuration. Either set both GIT_URL and GIT_BRANCH of the application to be built as Jenkins job parameters or put this Jenkinsfile into the same repository as the application to be built."
}
else if(!gitUrl) {
error "Parameter 'GIT_URL' not set in Jenkins job configuration. Either set both GIT_URL and GIT_BRANCH of the application to be built as Jenkins job parameters or put this Jenkinsfile into the same repository as the application to be built."
}
echo "[INFO] Building '${gitBranch}@${gitUrl}'."
return [url: gitUrl, branch: gitBranch]
}