Merge "Add build latest docker tag in postmerge job for OMEC repos"
diff --git a/jjb/pipeline/comac-in-a-box-gerrit.groovy b/jjb/pipeline/comac-in-a-box-gerrit.groovy
index dc2be39..e3f20e9 100644
--- a/jjb/pipeline/comac-in-a-box-gerrit.groovy
+++ b/jjb/pipeline/comac-in-a-box-gerrit.groovy
@@ -66,11 +66,26 @@
 
     stage ("Run COMAC-in-a-box"){
       steps {
-        sh label: 'Run Makefile', script: """
-          cd $HOME/automation-tools/comac-in-a-box/
-          sudo make reset-test
-          sudo make test
-          """
+        script{
+          try{
+            sh label: 'Run Makefile', script: """
+              cd $HOME/automation-tools/comac-in-a-box/
+              sudo make reset-test
+              sudo make test
+              """
+          } finally {
+            sh label: 'Archive Logs', script: '''
+              mkdir logs
+              mkdir logs/pods
+              kubectl get pods -n omec > logs/kubectl_get_pods_omec.log
+              for pod in $(kubectl get pods -n omec | awk '{print $1}' | tail -n +2)
+              do
+                kubectl logs -n omec $pod --all-containers > logs/pods/$pod.log || true
+              done
+            '''
+            archiveArtifacts artifacts: "logs/**/*.log", allowEmptyArchive: true
+          }
+        }
       }
     }
   }
diff --git a/jjb/pipeline/omec-fossa-scan.groovy b/jjb/pipeline/omec-fossa-scan.groovy
index c70f3eb..c7a3f3f 100644
--- a/jjb/pipeline/omec-fossa-scan.groovy
+++ b/jjb/pipeline/omec-fossa-scan.groovy
@@ -81,6 +81,12 @@
 
                         echo "Testing project: ${params.project}"
 
+                        if [ ! -f ".fossa.yml" ]
+                        then
+                          echo ".fossa.yml not found. This file is mandatory for the test to proceed."
+                          exit 1
+                        fi
+
                         echo "Run 'fossa init'"
                         fossa init --no-ansi --verbose