From f8e3b2e0e2bee8dcc6e6f72921cda3489d4f26e1 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Tue, 20 Sep 2022 22:49:51 +0800 Subject: [PATCH] added exit value for script --- pipelines/build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pipelines/build.sh b/pipelines/build.sh index 296c1f8..7504ed4 100644 --- a/pipelines/build.sh +++ b/pipelines/build.sh @@ -26,6 +26,7 @@ if [ "$JOB_NAME" != "csst_proto" ]; then curl -O https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/pipelines/test_codestyle.py fi coverage run -m pytest +unittest_status=$? echo "===================== make coverage =====================" coverage report @@ -36,6 +37,14 @@ echo "===================== importability =====================" python -c "from $JOB_NAME.top_level_interface import *" echo "===================== POST BUILD BELOW =====================" + +# the exit value is determined from unit tests +if [ "$unittest_status" != 0 ]; then + exit $unittest_status +else + exit 0 +fi + # In Jenkins: #!/bin/bash #sh -c "$(curl -fsSL https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/pipelines/build.sh)" \ No newline at end of file -- GitLab