From 23833fb2932ddf6d31a4406426bce8ce16444aad Mon Sep 17 00:00:00 2001 From: Thomas Frans Date: Fri, 19 Apr 2024 10:57:49 +0200 Subject: [PATCH] empty 7 --- .septentrio/Jenkinsfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.septentrio/Jenkinsfile b/.septentrio/Jenkinsfile index 6a105ec3dc16fa..d6e376de80ffb7 100644 --- a/.septentrio/Jenkinsfile +++ b/.septentrio/Jenkinsfile @@ -1,26 +1,38 @@ pipeline { triggers { + // Poll the Git repository every 5 minutes to detect changes. pollSCM('H/5 * * * *') } + // Run stages without specified agent on any available agent. agent any + // Parameters used for manual builds triggered in the Jenkins web UI. parameters { string(name: 'BOARDS', defaultValue: 'Pixhawk6C Pixhawk6X', description: 'A space-separated list of boards to build for') string(name: 'GIT_REVISION', defaultValue: 'Copter-0.0.0-citesting', description: 'The Git revision (commit, branch, tag...) to check out') } + // Options for the pipeline. options { + // Discard old builds to save space. buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '1', numToKeepStr: '') } stages { - // Check out the repository on the Jenkins server + // Check out the repository on the Jenkins server. stage('Checkout') { steps{ - git(branch: 'Copter-0.0.0-citesting', - url: 'https://github.com/flyingthingsintothings/ardupilot.git') + git(url: 'https://github.com/flyingthingsintothings/ardupilot.git') echo "$GIT_COMMIT" // We need all the tags locally to check them out. The documentation to do this with the builtin steps is not really useful. sh "git fetch --all" - sh "git checkout ${params.GIT_REVISION}" + script { + if (env.GIT_COMMIT) { + // Build started from polling SCM. + sh "git checkout $GIT_COMMIT" + } else { + // Build started by user with parameters. + sh "git checkout ${params.GIT_REVISION}" + } + } sh "./Tools/gittools/submodule-sync.sh" } }