File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,20 @@ error() {
1919
2020cleanup () {
2121 set +e
22+ # There is a chance that the log will not be written completely.
23+ # Exit the container and retrieve the last line of logs to ensure
24+ # that all logs have been read.
25+ info " Stopping container"
26+ $CONTAINER_RUNTIME stop --time 1 " $id " > /dev/null 2>&1
27+ $CONTAINER_RUNTIME logs --tail 1 " $id " > /dev/null 2>&1
28+
2229 { kill " $log_pid " && wait " $log_pid " ; } 2> /dev/null
2330 if [ -n " $CONTAINER_LOG_OUTPUT " ]; then
31+ info " Copying log"
2432 cp " $tmp_dir /docker_output.log" " $CONTAINER_LOG_OUTPUT "
2533 fi
2634 [ " $DEBUG " ] || rm -rf " $tmp_dir "
27- if [[ $id ]]; then
35+ if [[ $id ]]; then
2836 info " Deleting container"
2937 $CONTAINER_RUNTIME rm -vf " $id " > /dev/null
3038 fi
You can’t perform that action at this time.
0 commit comments