2023-06-29 13:40:43 +00:00
|
|
|
#!/usr/bin/env groovy
|
2021-04-14 11:48:00 +00:00
|
|
|
/**
|
|
|
|
* This job runs daily and executes `pod repo update` on MacOS
|
|
|
|
* This is done to avoid issues with out of date repo causing errors like:
|
|
|
|
*
|
|
|
|
* Failed with exit code 1 (in target 'StatusImPR' from project 'StatusIm')
|
|
|
|
**/
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
label params.HOST_LABEL
|
|
|
|
}
|
|
|
|
|
|
|
|
triggers {
|
|
|
|
/* Run daily at 2am */
|
|
|
|
cron('H 2 * * *')
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 5, unit: 'MINUTES')
|
|
|
|
/* Limit builds retained */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'HOST_LABEL',
|
|
|
|
description: 'Label of host to run on',
|
|
|
|
/* Using startTimeInMillis to randomize which host gets the update. */
|
2021-11-24 18:25:06 +00:00
|
|
|
defaultValue: "maci7-0${(currentBuild.startTimeInMillis % 3) + 1}",
|
2021-04-14 11:48:00 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Update') {
|
|
|
|
steps {
|
|
|
|
sh 'pod repo update'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|