Kill containers running days
This commit is contained in:
parent
d1ca508100
commit
cad4844d66
|
|
@ -4,7 +4,7 @@ pipeline {
|
|||
}
|
||||
|
||||
triggers {
|
||||
cron('0 0 * * 6')
|
||||
cron('0 0 * * *')
|
||||
}
|
||||
|
||||
options {
|
||||
|
|
@ -17,8 +17,8 @@ pipeline {
|
|||
label 'agent1'
|
||||
}
|
||||
steps {
|
||||
sh 'sh kill_days_containers.sh'
|
||||
sh 'docker system prune -a -f'
|
||||
sh 'docker network prune -f'
|
||||
}
|
||||
}
|
||||
stage('Clean docker images agent2') {
|
||||
|
|
@ -26,8 +26,8 @@ pipeline {
|
|||
label 'agent2'
|
||||
}
|
||||
steps {
|
||||
sh 'sh kill_days_containers.sh'
|
||||
sh 'docker system prune -a -f'
|
||||
sh 'docker network prune -f'
|
||||
}
|
||||
}
|
||||
stage('Clean docker images agent3') {
|
||||
|
|
@ -35,8 +35,8 @@ pipeline {
|
|||
label 'agent3'
|
||||
}
|
||||
steps {
|
||||
sh 'sh kill_days_containers.sh'
|
||||
sh 'docker system prune -a -f'
|
||||
sh 'docker network prune -f'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo docker ps | grep "days" | sudo docker kill $(awk '{print($1);}')
|
||||
Loading…
Reference in New Issue