diff --git a/Jenkinsfile b/Jenkinsfile index 4195f6b..e6ba29a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,7 @@ pipeline { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh 'sh kill_days_containers.sh' sh 'docker system prune -a -f' + sh 'install timeout_docker.sh /usr/local/bin/docker' } } } @@ -31,6 +32,7 @@ pipeline { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh 'sh kill_days_containers.sh' sh 'docker system prune -a -f' + sh 'install timeout_docker.sh /usr/local/bin/docker' } } } @@ -42,6 +44,7 @@ pipeline { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh 'sh kill_days_containers.sh' sh 'docker system prune -a -f' + sh 'install timeout_docker.sh /usr/local/bin/docker' } } } @@ -53,6 +56,7 @@ pipeline { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh 'sh kill_days_containers.sh' sh 'docker system prune -a -f' + sh 'install timeout_docker.sh /usr/local/bin/docker' } } } diff --git a/timeout_docker.sh b/timeout_docker.sh new file mode 100644 index 0000000..f0eec4d --- /dev/null +++ b/timeout_docker.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -x +timeout -f --kill-after=1 5h /usr/bin/docker "$@" +