Skip to content

Commit 41d3be5

Browse files
committed
use trap
1 parent 8fec2fb commit 41d3be5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

wercker.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ integration-test:
7070
- script:
7171
name: Run integration tests
7272
code: |
73+
function finish {
74+
# clean up
75+
yum clean all
76+
77+
# store the artifacts so we can download them easily
78+
tar czvf ${WERCKER_REPORT_ARTIFACTS_DIR}/integration-test-data.tar.gz /pipeline/output/*
79+
}
80+
trap finish EXIT
81+
7382
# Copy Docker file to OCI host and load into local Docker registry
7483
# yum install -y openssh-clients
7584
# echo -e $OCI_K8S_SSHKEY > /tmp/ssh_key
@@ -158,19 +167,8 @@ integration-test:
158167
echo "$IMAGE_NAME_OPERATOR:$IMAGE_TAG_OPERATOR"
159168
160169
# integration tests
161-
set -x
162170
$WERCKER_SOURCE_DIR/src/integration-tests/bash/run.sh
163-
local exit_code=$?
164171
165-
# clean up
166-
yum clean all
167-
168-
# store the artifacts so we can download them easily
169-
tar czvf ${WERCKER_REPORT_ARTIFACTS_DIR}/integration-test-data.tar.gz /pipeline/output/*
170-
171-
set +x
172-
exit ${exit_code}
173-
174172
175173
# This pipeline runs quality checks
176174
quality:

0 commit comments

Comments
 (0)