diff --git a/Jenkinsfile b/Jenkinsfile index c684df7..4195f6b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { } triggers { - cron('0 0 * * *') + cron('@daily') } options { @@ -17,7 +17,10 @@ pipeline { label 'agent1' } steps { - sh 'sh kill_days_containers.sh' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'sh kill_days_containers.sh' + sh 'docker system prune -a -f' + } } } stage('Clean docker images agent2') { @@ -25,8 +28,10 @@ pipeline { label 'agent2' } steps { - sh 'sh kill_days_containers.sh' - sh 'docker system prune -a -f' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'sh kill_days_containers.sh' + sh 'docker system prune -a -f' + } } } stage('Clean docker images agent3') { @@ -34,8 +39,21 @@ pipeline { label 'agent3' } steps { - sh 'sh kill_days_containers.sh' - sh 'docker system prune -a -f' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'sh kill_days_containers.sh' + sh 'docker system prune -a -f' + } + } + } + stage('Clean docker images agent4') { + agent { + label 'agent3' + } + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'sh kill_days_containers.sh' + sh 'docker system prune -a -f' + } } } }