Files
metricspi/ci/Jenkinsfile
Dustin C. Hatch 332e36a388
Some checks reported errors
dustin/metricspi/pipeline/head Something is wrong with the build of this commit
ci: Use a dynamic PVC for the workspace volume
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.
2022-12-21 09:56:11 -06:00

75 lines
1.7 KiB
Groovy

// vim: set ft=groovy :
pipeline {
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
defaultContainer 'buildroot'
workspaceVolume dynamicPVC()
}
}
options {
buildDiscarder logRotator(numToKeepStr: '5')
disableConcurrentBuilds()
}
environment {
BUILDROOT_SRC = "${env.WORKSPACE}/buildroot"
TMPDIR = "${env.WORKSPACE_TMP}"
TEMP = "${env.WORKSPACE_TMP}"
TMP = "${env.WORKSPACE_TMP}"
}
stages {
stage('Prepare') {
steps {
checkout poll: false, scm: [
$class: 'GitSCM',
branches: [[name: '2022.05.x']],
doGenerateSubmoduleConfigurations: false,
userRemoteConfigs: [[url: 'git://git.buildroot.net/buildroot']],
extensions: [
[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'buildroot',
],
],
]
}
}
stage('Build') {
parallel {
stage('Build Initramfs') {
steps {
sh 'make initramfs'
}
}
stage('Build Rootfs') {
steps {
sh 'make rootfs'
}
}
}
}
stage('Package') {
steps {
sh 'make package'
}
}
}
post {
success {
dir('_build') {
archiveArtifacts 'metricspi.tar'
}
}
}
}