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