From: garciadeblas Date: Thu, 17 Nov 2022 11:58:49 +0000 (+0100) Subject: Add logs before removing repo X-Git-Tag: v12.0.4~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F12699%2F1;p=osm%2Fdevops.git Add logs before removing repo Change-Id: I8d9cde6217f24c7c532bee441ce34f4563697f56 Signed-off-by: garciadeblas --- diff --git a/jenkins/ci-pipelines/ci_helper.groovy b/jenkins/ci-pipelines/ci_helper.groovy index 0b41169d..4f1d32da 100644 --- a/jenkins/ci-pipelines/ci_helper.groovy +++ b/jenkins/ci-pipelines/ci_helper.groovy @@ -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 } diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index e5159938..3f1190f9 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -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}" } }