Adding the git fetch to avoid build failure at git describe
[osm/devops.git] / jenkins / ci-pipelines / ci_stage_2.groovy
index ddbd80a..4d23cf1 100644 (file)
@@ -19,7 +19,8 @@ def project_checkout(url_prefix,project,refspec,revision) {
     // checkout the project
     // this is done automaticaly by the multibranch pipeline plugin
     // git url: "${url_prefix}/${project}"
-
+    
+    sh "git fetch --tags"
     sh "git fetch origin ${refspec}"
     if (GERRIT_PATCHSET_REVISION.size() > 0 ) {
         sh "git checkout -f ${revision}"
@@ -39,7 +40,12 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa
     }
 
     stage('License Scan') {
+      if (!JOB_NAME.contains('merge')) {
         sh "devops/tools/license_scan.sh"
+      } 
+      else {
+        println("skip the scan for merge")
+      }
     }
 
     container_name = "${project}-${branch}".toLowerCase()