Skip to content

Commit 8b8506e

Browse files
authored
ci: add trap function to look for core files (#15919)
1 parent ce78c2f commit 8b8506e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ci/cloudbuild/builds/lib/quickstart.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ source module ci/cloudbuild/builds/lib/cmake.sh
3131
source module ci/etc/quickstart-config.sh
3232
source module ci/lib/io.sh
3333

34+
function cleanup() {
35+
local exit_status=$?
36+
io::log_h2 "cleanup on EXIT with exit_status=${exit_status}"
37+
io::run find . -name '*core*'
38+
}
39+
40+
trap 'cleanup' INT TERM EXIT
41+
3442
# Builds the CMake and Makefile quickstart programs but DOES NOT RUN THEM. This
3543
# is a useful way to test that the artifacts installed by `google-cloud-cpp`
3644
# work for compilation. This function requires a single argument specifying the
@@ -97,8 +105,6 @@ function quickstart::run_cmake_and_make() {
97105
mapfile -t run_args < <(quickstart::arguments "${lib}")
98106
quickstart::run_one_quickstart "${prefix}" "${lib}" "${run_args[@]}"
99107
done
100-
101-
io::run find . -name '*core*'
102108
}
103109

104110
function quickstart::run_gcs_grpc_quickstart() {

0 commit comments

Comments
 (0)