From 576ca7dd0e291e4da25b77baae354eba63e9c624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Tue, 4 Sep 2018 11:35:16 +0200 Subject: [PATCH] fix the Scripts not permitted to use method hudson.plugins.git.GitSCM getUserRemoteConfigs error --- Jenkinsfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 160f9fe..4d6a4f0 100644 --- a/Jenkinsfile +++ b/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 = [