Skip to content

Commit

Permalink
midpoint-main-generic-oracle-pipeline: pod log archival inside if
Browse files Browse the repository at this point in the history
This is consistent with log archival for test logs.
  • Loading branch information
virgo47 committed Oct 4, 2022
1 parent 090faa3 commit 3f937fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/jenkins/midpoint-main-generic-oracle-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ EOF
])

if (currentBuild.result == 'UNSTABLE' || params.ARCHIVE_LOGS) {
sh "find . -wholename '*/target/test.log' -print0 | tar -czf test-logs.tgz --null -T -"
sh "find . -wholename '*/target/test.log' -print0 | tar cfvz test-logs.tgz --null -T -"
archiveArtifacts allowEmptyArchive: true, artifacts: "test-logs.tgz", followSymlinks: false
}
}
Expand All @@ -313,15 +313,16 @@ kubectl logs -n jenkins \$(cat ../logs-${JOB_NAME}-${BUILD_NUMBER}/dbpod) -c ora
kubectl delete -n jenkins \\
\$(cat ../logs-${JOB_NAME}-${BUILD_NUMBER}/dbpod) \\
\$(cat ../logs-${JOB_NAME}-${BUILD_NUMBER}/dbpvc)

echo "Preparing the archive with the logs..."
tar -cvzf logs.tgz ../logs-${JOB_NAME}-${BUILD_NUMBER}
"""
} catch (err) {
echo "Caught: ${err}"

if (currentBuild.result == 'UNSTABLE' || params.ARCHIVE_LOGS) {
sh "tar cfvz oracle-logs.tgz ../logs-${JOB_NAME}-${BUILD_NUMBER}"
archiveArtifacts allowEmptyArchive: true, artifacts: 'oracle-logs.tgz', followSymlinks: false
}
} catch (e) {
echo "Error during Oracle pod cleanup: ${e}"
}
}
archiveArtifacts allowEmptyArchive: true, artifacts: 'logs.tgz', followSymlinks: false
}

try {
Expand Down

0 comments on commit 3f937fb

Please sign in to comment.