2023-06-29 13:40:43 +00:00
|
|
|
#!/usr/bin/env groovy
|
2024-10-23 07:15:59 +00:00
|
|
|
library 'status-jenkins-lib@v1.9.13'
|
2023-02-21 18:13:20 +00:00
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
label 'linux'
|
|
|
|
}
|
|
|
|
|
|
|
|
triggers {
|
|
|
|
cron('H 5 * * *')
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 15, unit: 'MINUTES')
|
|
|
|
/* Disable concurrent jobs */
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* Don't keep more than 50 builds */
|
|
|
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Get Nodes') {
|
|
|
|
steps { script {
|
|
|
|
stagePerNode = nodesByLabel('macos').collectEntries {
|
|
|
|
["${it}" : generateNodeCleanupStage(it)]
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Clean Xcode') {
|
|
|
|
steps { script {
|
|
|
|
parallel stagePerNode
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def generateNodeCleanupStage(nodeLabel) {
|
|
|
|
return { stage(nodeLabel) {
|
|
|
|
node(nodeLabel) {
|
|
|
|
dir('/Users/jenkins/Library/Developer/Xcode') {
|
|
|
|
sh 'rm -fr Archives DerivedData'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|