X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_2.groovy;h=4d23cf1759129bbd2538d3c21edf2cde516683fc;hb=7ca094a4c86698b4403fdde1c59545d886a0871b;hp=52e2f1d336a79b6bcd89c00786c3151778a1e9f7;hpb=9054244cd2a7451f75157d7fa3ec5d2ff88176be;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 52e2f1d3..4d23cf17 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -1,7 +1,7 @@ /* Copyright 2017 Sandvine * * All Rights Reserved. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at @@ -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() @@ -55,17 +61,22 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa withDockerContainer(image: "${container_name}", args: docker_args) { stage('Test') { sh 'devops-stages/stage-test.sh' + if (fileExists('coverage.xml')) { + cobertura coberturaReportFile: 'coverage.xml' + } + if (fileExists('nosetests.xml')) { + junit 'nosetests.xml' + } } stage('Build') { sh(returnStdout:true, script: 'devops-stages/stage-build.sh').trim() } - } - - stage('Archive') { - sh "mkdir -p changelog" - sh "devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html" - sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() - ci_helper.archive(artifactory_server,mdg,branch,'untested') + stage('Archive') { + sh "mkdir -p changelog" + sh "devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html" + sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() + ci_helper.archive(artifactory_server,mdg,branch,'untested') + } } if ( do_stage_3 ) {