pr_epm: enhance CI/CD error handling
@@ -136,7 +136,9 @@ jobs:
with:
timeout_minutes: 20
max_attempts: 5
- command: docker exec $inclavare_test bash -c 'apt-get update -y && apt-get install -y wget iptables gnupg libprotobuf-c1 libbinutils;
+ command: docker exec $inclavare_test bash -c 'trap "error_handler $?" ERR;
+ error_handler() { local err=$?; printf "Cleaning up with exit code $err ...\n"; exit $err; };
+ apt-get update -y && apt-get install -y wget iptables gnupg libprotobuf-c1 libbinutils;
echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main" | tee /etc/apt/sources.list.d/intel-sgx.list && wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add -;
apt-get update -y && apt-get install -y libsgx-dcap-quote-verify libsgx-dcap-default-qpl;
cd /root/inclavare-containers/${{ matrix.tag }};
@@ -155,7 +157,10 @@ jobs:
with:
timeout_minutes: 20
max_attempts: 5
- command: docker exec $inclavare_test bash -c 'cd /root/inclavare-containers/${{ matrix.tag }};
+ command: docker exec $inclavare_test bash -c 'trap "error_handler $?" ERR;
+ error_handler() { local err=$?; printf "Cleaning up with exit code $err ...\n"; exit $err; };
+ sleep 20 && systemctl stop dnf-makecache.timer;
+ cd /root/inclavare-containers/${{ matrix.tag }};
yum -y install yum-utils wget iptables protobuf-c;
wget -c https://download.01.org/intel-sgx/latest/linux-latest/distro/centos8.2-server/sgx_rpm_local_repo.tgz;
tar xzf sgx_rpm_local_repo.tgz;
@@ -175,7 +180,9 @@ jobs:
with:
timeout_minutes: 20
max_attempts: 5
- command: docker exec $inclavare_test bash -c 'cd /root/inclavare-containers/${{ matrix.tag }};
+ command: docker exec $inclavare_test bash -c 'trap "error_handler $?" ERR;
+ error_handler() { local err=$?; printf "Cleaning up with exit code $err ...\n"; exit $err; };
+ cd /root/inclavare-containers/${{ matrix.tag }};
yum install -y alinux-release-experimentals;
yum install -y yum-utils wget tar gcc iptables protobuf-c-${{ env.ALINUX2_PROTOBUF_C_VERSION }} libseccomp-devel;
yum-config-manager --add-repo https://enclave-cn-beijing.oss-cn-beijing.aliyuncs.com/repo/alinux/enclave-expr.repo;
