timescaledb/scripts/bundle_coredumps.sh
Sven Klemm 8a1976a6b9 Upload coredumps as artifact
This patch adds collecting coredumps to the regression workflow
in addition to the binary all shared libraries used by the coredump
are collected as well.
2020-06-29 21:48:12 +02:00

21 lines
430 B
Bash
Executable File

#!/bin/bash
TARGET=coredumps
COREDUMP_DIR=/var/lib/systemd/coredump
set -e
mkdir -p "$TARGET"
# get information from gdb
info=$(echo "info sharedlibrary" | coredumpctl gdb)
executable=$(echo "$info" | grep Executable | sed -e 's!^[^/]\+!!')
cp "$executable" "$TARGET"
cp ${COREDUMP_DIR}/* "$TARGET"
# copy libraries extracted from gdb info
echo "$info" | grep '^0x' | sed -e 's!^[^/]\+!!' | xargs -ILIB cp "LIB" "$TARGET"