ci: Use a dynamic PVC for the workspace volume
dustin/metricspi/pipeline/head Something is wrong with the build of this commit Details

Using an actual persistent volume for the workspace ultimately doesn't
work with multibranch pipelines.  When a branch/PR goes away and the
corresponding Jenkins job is deleted, the workspace cannot be cleaned up
because it is not mounted anywhere.  As such, we will just use a dynamic
PVC to ensure that the workspace is always cleaned up and nothing gets
left behind.  This of course obviates the need for the `Clean`
parameter.
master
Dustin 2022-12-21 09:53:15 -06:00
parent 06b04abf47
commit 332e36a388
1 changed files with 1 additions and 14 deletions

15
ci/Jenkinsfile vendored
View File

@ -5,9 +5,7 @@ pipeline {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
defaultContainer 'buildroot'
workspaceVolume persistentVolumeClaimWorkspaceVolume(
claimName: 'jenkins-ws-metricspi'
)
workspaceVolume dynamicPVC()
}
}
@ -16,12 +14,6 @@ pipeline {
disableConcurrentBuilds()
}
parameters {
booleanParam \
name: 'Clean',
description: 'Clean the workspace and perform a full rebuild'
}
environment {
BUILDROOT_SRC = "${env.WORKSPACE}/buildroot"
TMPDIR = "${env.WORKSPACE_TMP}"
@ -32,11 +24,6 @@ pipeline {
stages {
stage('Prepare') {
steps {
script {
if (params.Clean) {
sh 'rm -rf _build'
}
}
checkout poll: false, scm: [
$class: 'GitSCM',
branches: [[name: '2022.05.x']],