Browse Source

test

master
Nicolas Massé 8 years ago
parent
commit
2696744006
  1. 24
      Jenkinsfile

24
Jenkinsfile

@ -1,26 +1,20 @@
#!/usr/bin/env groovy #!/usr/bin/env groovy
import groovy.json.JsonOutput import groovy.json.JsonOutput
// for inline scripts def gitRepo = ""
def gitRepo def gitBranch = params.GIT_BRANCH != null && params.GIT_BRANCH != "" ? params.GIT_BRANCH : "master"
def gitBranch
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
checkout scm if (gitRepo == null || gitRepo == "") {
gitRepo = scm.getUserRemoteConfigs()[0].getUrl() checkout scm
gitBranch = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() gitRepo = scm.getUserRemoteConfigs()[0].getUrl()
} else {
sh 'env' // for inline scripts
echo "${gitRepo} ${gitBranch}" git url: gitRepo, branch: gitBranch
sh 'false' }
// for inline scripts
//git url: gitRepo
//gitRepo = "https://github.com/nmasse-itix/summit-api.git"
//gitBranch = "master"
} }
def towerExtraVars = [ def towerExtraVars = [

Loading…
Cancel
Save