This is an automated email from the ASF dual-hosted git repository.

jstastnycz pushed a commit to branch radtriste-fix-pipelines
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-images.git

commit b53c30433c7567064dba4f0e6c1733a5990482ae
Author: jstastny-cz <[email protected]>
AuthorDate: Thu Nov 16 10:21:51 2023 +0100

    tweak logs collection
---
 .ci/jenkins/Jenkinsfile.build-image | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.build-image 
b/.ci/jenkins/Jenkinsfile.build-image
index 2ba205f5..d1967bae 100644
--- a/.ci/jenkins/Jenkinsfile.build-image
+++ b/.ci/jenkins/Jenkinsfile.build-image
@@ -188,7 +188,7 @@ pipeline {
                         unstable "Testing error(s) for image 
${getBuildImageName()}"
                     } finally {
                         junit testResults: 'target/**/*.xml', 
allowEmptyResults: true
-                        archiveArtifacts artifacts: 'target/**/*.xml, 
**/*-build.log', allowEmptyArchive: true
+                        archiveArtifacts artifacts: 'target/**/*.xml', 
allowEmptyArchive: true
                     }
                 }
             }
@@ -198,12 +198,17 @@ pipeline {
         always {
             script {
                 updateGithubCommitStatusFromBuildResult()
-                archiveArtifacts artifacts: '**/*-build.log', 
allowEmptyArchive: true
+                collectContainerLogs()
+                archiveArtifacts artifacts: '**/*-build.log, 
**/*-container.log', allowEmptyArchive: true
             }
         }
     }
 }
 
+void collectContainerLogs() {
+    sh 'for container in $(docker container ls --format "{{.Names}}"); do 
docker logs $container >& ${container}-container.log; done'
+}
+
 String getMakeBuildImageArgs() {
     List args = []
     if (getBuildKogitoAppsRef()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to