jenkins-automaintenance/Jenkinsfile

35 lines
729 B
Groovy

pipeline {
agent none
triggers {
cron("59 23 * * 1") // Clean up every monday
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Clean docker on agent2') {
agent {
label 'agent2'
}
steps {
sh 'docker system prune -a -f'
sh 'docker network prune -f'
}
}
stage('Clean docker on built-in-node') {
agent {
label 'built_in_node'
}
steps {
sh 'docker system prune -a -f'
sh 'docker network prune -f'
}
}
}
}