Add logs before removing repo 99/12699/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 17 Nov 2022 11:58:49 +0000 (12:58 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 17 Nov 2022 11:58:49 +0000 (12:58 +0100)
Change-Id: I8d9cde6217f24c7c532bee441ce34f4563697f56
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
jenkins/ci-pipelines/ci_helper.groovy
jenkins/ci-pipelines/ci_stage_3.groovy

index 0b41169..4f1d32d 100644 (file)
@@ -39,15 +39,15 @@ def get_archive(artifactory_server, mdg, branch, build_name, build_number, patte
     def results = server.download(downloadSpec)
     // Save the list of URLs that we need to pass to the dockerfiles for build
     def debian_packages = []
-    for ( result in results.getDependencies()) {
+    for ( result in results.getDependencies() ) {
         if (result.remotePath.contains(".deb")) {
             debian_packages.add(result.remotePath)
         }
     }
 
     // workaround.  flatten repo to remove specific build num from the directory
-    sh "cp -R ${branch}/${build_number}/* ."
-    sh "rm -rf ${branch}/${build_number}"
+    sh "cp -Rv ${branch}/${build_number}/* ."
+    sh "rm -rfv ${branch}/${build_number}"
 
     return debian_packages
 }
index e515993..3f1190f 100644 (file)
@@ -215,7 +215,10 @@ node("${params.NODE}") {
 ///////////////////////////////////////////////////////////////////////////////////////
         stage('Copy Artifacts') {
             // cleanup any previous repo
-            sh 'rm -rf repo'
+            sh "pwd"
+            sh "tree -fD repo"
+            sh "lsof repo"
+            sh "rm -rfv repo"
             dir('repo') {
                 packageList = []
                 dir("${RELEASE}") {
@@ -725,8 +728,8 @@ EOF"""
             } // if (params.SAVE_ARTIFACTS_OVERRIDE || stage_archive)
         } // dir(OSM_DEVOPS)
     } finally {
-       stage('Archive Container Logs') {
-            if ( ARCHIVE_LOGS_FLAG ) {
+        stage('Archive Container Logs') {
+            if (ARCHIVE_LOGS_FLAG) {
                 try {
                     // Archive logs
                     remote = [
@@ -746,16 +749,16 @@ EOF"""
             } // end if ( ARCHIVE_LOGS_FLAG )
         }
         stage('Cleanup') {
-            if ( params.DO_INSTALL && server_id != null) {
+            if (params.DO_INSTALL && server_id != null) {
                 delete_vm = true
-                if (error && params.SAVE_CONTAINER_ON_FAIL ) {
+                if (error && params.SAVE_CONTAINER_ON_FAIL) {
                     delete_vm = false
                 }
-                if (!error && params.SAVE_CONTAINER_ON_PASS ) {
+                if (!error && params.SAVE_CONTAINER_ON_PASS) {
                     delete_vm = false
                 }
 
-                if ( delete_vm ) {
+                if (delete_vm) {
                     if (server_id != null) {
                         println("Deleting VM: $server_id")
                         sh """#!/bin/sh -e
@@ -767,12 +770,12 @@ EOF"""
                     }
                 }
             }
-            if ( http_server_name != null ) {
+            if (http_server_name != null) {
                 sh "docker stop ${http_server_name} || true"
                 sh "docker rm ${http_server_name} || true"
             }
 
-            if ( devopstempdir != null ) {
+            if (devopstempdir != null) {
                 sh "rm -rf ${devopstempdir}"
             }
         }