Browse Source

Add git checkout and matrix build.

testing
Mark Hindley 2 years ago
parent
commit
19bc3a1cd0
  1. 67
      Jenkinsfile

67
Jenkinsfile

@ -1,25 +1,62 @@
pipeline {
parameters {
string defaultValue: 'experimental', description: 'Target distribution', name: 'codename', trim: true
string description: 'Source package', name: 'srcpackage', trim: true
choice(name: 'ARCH_FILTER', choices: ['default', 'i386', 'amd64', 'armel', 'armhf', 'arm64', 'ppc64el', 'all'], description: 'Limit run to this architecture')
/* Keep this list of archs in sync with DSC_ARCHITECTURES and axis values below.
'default' builds the architectures defined in the source dsc file.
*/
choice(name: 'ARCH_FILTER', choices: ['default', 'i386', 'amd64', 'armel', 'armhf', 'arm64', 'ppc64el', 'all'], description: 'Limit build to this architecture')
}
environment {
DSC_ARCHITECTURES = 'any'.replaceFirst(/\b(linux-)?any\b/,'i386 amd64 armel armhf arm64 ppc64el')
}
agent none
agent {label 'keysign'}
stages {
stage('Orchestrate') {
matrix {
agent {
label arch
stage('Source'){
environment {
SKIP_DCH = 'true'
KEEP_SOURCE_CHANGES = 'true'
}
steps {
buildName "${params.srcpackage} (${params.codename})"
script {
checkout(
changelog: false,
poll: false,
scm: [$class: 'GitSCM',
branches: [[name: '*/suites/$codename']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CleanBeforeCheckout'],
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'source']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: '5002aa4f-1e30-4569-a051-29c4c42c394a',
url: 'https://git.devuan.org/devuan-packages/$srcpackage']]
]).each { k,v -> env.setProperty(k, v) }
}
dir ('source'){
script {
version = sh(script: 'dpkg-parsechangelog -S version', returnStdout: true).trim()
}
buildName "${params.srcpackage}_${version} (${params.codename})"
}
sh('/usr/bin/generate-git-snapshot')
}
}
stage('Orchestrate') {
environment {
DSC_ARCHITECTURES = sh(script: "sed -n -e \'/^Architecture: \\+/ s/^Architecture: \\+// p\' " + BUILD_DISPLAY_NAME.replaceAll('/ \\(.*\\)$', ''), returnStdout: true).trim().replaceFirst(/\b(linux-)?any\b/,'i386 amd64 armel armhf arm64 ppc64el')
}
matrix {
agent {label arch}
when {
allOf {
expression { env.arch in env.DSC_ARCHITECTURES.tokenize() }
expression { params.ARCH_FILTER == env.arch || 'default' }
}
beforeAgent true }
}
beforeAgent true
}
axes {
axis {
name 'arch'
@ -35,5 +72,13 @@ pipeline {
}
}
}
stage('Deploy to DAK'){
agent {label 'repository'}
steps{
echo 'Deploy'
}
}
}
}

Loading…
Cancel
Save