jenkins-automaintenance/Jenkinsfile

37 lines
720 B
Groovy

pipeline {
agent {
label 'linux'
}
trigger {
cron('0 0 * * *')
}
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'
}
}
}
}