Change-Id: Idee735506feebead6989a5e891004b079f0d3b35
Signed-off-by: Felipe Vicens <felipe.vicens@atos.net>
}
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}") {