Browse Source

fix the Scripts not permitted to use method hudson.plugins.git.GitSCM getUserRemoteConfigs error

pull/1/head
Nicolas Massé 7 years ago
parent
commit
576ca7dd0e
  1. 12
      Jenkinsfile

12
Jenkinsfile

@ -1,20 +1,16 @@
#!/usr/bin/env groovy
import groovy.json.JsonOutput
def gitRepo = ""
def gitRepo = params.GIT_REPO
def gitBranch = params.GIT_BRANCH != null && params.GIT_BRANCH != "" ? params.GIT_BRANCH : "master"
node('nodejs') {
// Get Source Code from SCM (Git) as configured in the Jenkins Project
stage('Checkout Source') {
// For Jenkinsfile from GIT
if (gitRepo == null || gitRepo == "") {
checkout scm
gitRepo = scm.getUserRemoteConfigs()[0].getUrl()
} else {
// for inline scripts
git url: gitRepo, branch: gitBranch
}
checkout scm
// for inline scripts
//git url: gitRepo, branch: gitBranch
}
def towerExtraVars = [

Loading…
Cancel
Save