Merge "RO, NBI, LCM and osmclient: Update pip to latest version"
authormadavi <jm00553988@techmahindra.com>
Tue, 10 Sep 2019 09:32:34 +0000 (11:32 +0200)
committerGerrit Code Review <root@osm.etsi.org>
Tue, 10 Sep 2019 09:32:34 +0000 (11:32 +0200)
Jenkinsfile
installers/full_install_osm.sh
jenkins/ci-pipelines/ci_stage_2.groovy
tools/license_scan.sh

index 9d7ca87..56a0830 100644 (file)
@@ -1,3 +1,20 @@
+/* Copyright 2019 ETSI
+ *
+ * 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
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *   License for the specific language governing permissions and limitations
+ *   under the License.
+ */
+
 properties([
     parameters([
         string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'),
@@ -13,6 +30,10 @@ properties([
 def devops_checkout() {
     dir('devops') {
         git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH
+        sh "git fetch origin ${params.GERRIT_REFSPEC}"
+        if (params.GERRIT_PATCHSET_REVISION.size() > 0 ) {
+           sh "git checkout -f ${params.GERRIT_PATCHSET_REVISION}"
+        }
     }
 }
 
index 35c8706..be160d6 100755 (executable)
@@ -630,7 +630,7 @@ function install_docker_compose() {
 
 function install_juju() {
     echo "Installing juju"
-    sudo snap install juju --classic
+    sudo snap install juju --classic --channel=2.5/stable
     [ -z "$INSTALL_NOLXD" ] && sudo dpkg-reconfigure -p medium lxd
     echo "Finished installation of juju"
     return 0
index d0e9d9d..ddbd80a 100644 (file)
@@ -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
@@ -55,6 +55,12 @@ 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()
index 2c5fb4a..71d283f 100755 (executable)
@@ -18,7 +18,7 @@
 # Change log:
 # 1. Bug 722 : Jayant Madavi : JM00553988@techmahindra.com : Enhancement to use new fossology server. Had to change the variable name at #    couple of places, while scanning the variable name was adding curl as a license.
 # 2. Bug 542 : Jayant Madavi, Mrityunjay Yadav : JM00553988@techmahindra.com : 24-jul-2019 : Enhancement to raise exit in case files modified or added does #    not contain license.
-# 3. 
+# 3. Bug 542  : Jayant Madavi, Mrityunjay Yadav : JM00553988@techmahindra.com :add exception list. for now as inLine. later need to create a variable for exception_list
  
 echo GERRIT BRANCH is $GERRIT_BRANCH
 dpkg -l wget &>/dev/null ||sudo apt-get install -y wget
@@ -29,12 +29,12 @@ dpkg -l curl &>/dev/null ||sudo apt-get install -y curl
 apache=0
 nolicense=0
 other=0
-
+exception_list="':(exclude)*.pdf' ':(exclude)*.png' ':(exclude)*.jpeg' ':(exclude)*.jpg' ':(exclude)*.gif' ':(exclude)*.json'"
 git fetch
 
 RE="FATAL: your file did not get passed through"
 
-for file in $(git diff --name-only origin/$GERRIT_BRANCH); do
+for file in $(echo ${exception_list} | xargs git diff --name-only origin/$GERRIT_BRANCH -- . ); do
     if [ -f $file ]; then
         if [ -s $file ]; then
             licnse=$(curl -s -X POST  -H 'Accept: text' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive'  -H 'Content-Type: multipart/form-data'  -H 'cache-control: no-cache'  -F "file_input=@\"$file\""  -F 'showheader=1' https://fossology-osm.etsi.org/?mod=agent_nomos_once |grep "A one shot license analysis shows the following license(s) in file"|sed -n 's:.*<strong>\(.*\)</strong>.*:\1:p' |xargs)