ci: add Jenkinsfile for pod repo updates

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-04-14 13:48:00 +02:00
parent e307b4faa6
commit 7eca3c42d7
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,43 @@
/**
* 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. */
defaultValue: "macos-0${(currentBuild.startTimeInMillis % 3) + 1}",
)
}
stages {
stage('Update') {
steps {
sh 'pod repo update'
}
}
}
}