jenkins-automaintenance/Jenkinsfile

46 lines
968 B
Groovy

pipeline {
agent {
label 'linux'
}
triggers {
cron('0 0 * * 6')
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Clean docker images agent1') {
agent {
label 'agent1'
}
steps {
sh 'docker system prune -a -f'
sh 'docker network prune -f'
}
}
stage('Clean docker images agent2') {
agent {
label 'agent2'
}
steps {
sh 'docker system prune -a -f'
sh 'docker network prune -f'
}
}
stage('Clean docker images agent3') {
agent {
label 'agent3'
}
steps {
sh 'docker system prune -a -f'
sh 'docker network prune -f'
}
}
}
}