From: Felipe Vicens Date: Fri, 26 Jun 2020 20:52:23 +0000 (+0200) Subject: Updating the logs collection from robot tests X-Git-Tag: release-v9.0-start~102 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F9211%2F2;p=osm%2Fdevops.git Updating the logs collection from robot tests Change-Id: Idee735506feebead6989a5e891004b079f0d3b35 Signed-off-by: Felipe Vicens --- diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 671482cb..f4eaa10b 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -102,8 +102,9 @@ def run_robot_systest(stackName,tagName,testName,envfile=null,kubeconfig=null,cl } def archive_logs(stackName) { - sh "docker service ls |grep \"${stackName}\"| awk '{print \$2}'| xargs -iy docker service logs y --timestamps &> containers_logs.txt" - archiveArtifacts artifacts: 'containers_logs.txt' + sh "docker service ls |grep \"${stackName}\"| awk '{print \$2}' | xargs -iy docker ps -af name=y --format \"{{.ID}} {{.Names}}\" --no-trunc | awk '{ print \"sudo cp /var/lib/docker/containers/\"\$1\"/\"\$1\"-json.log \"\$2\".log\"}' | xargs -iy bash y " + sh "sudo chown jenkins: osm*.log" + archiveArtifacts artifacts: '*.log' } node("${params.NODE}") {