Jenkinsfile: run DCO check before everything else
This will run the DCO check in a lightweight alpine container, before running other stages, and before building the development image/container (which can take a long time). A Jenkins parameter was added to optionally skip the DCO check (skip_dco) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a176d30c54
commit
d6f7909c76
|
@ -14,6 +14,7 @@ pipeline {
|
||||||
booleanParam(name: 'powerpc', defaultValue: true, description: 'PowerPC (ppc64le) Build/Test')
|
booleanParam(name: 'powerpc', defaultValue: true, description: 'PowerPC (ppc64le) Build/Test')
|
||||||
booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test')
|
booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test')
|
||||||
booleanParam(name: 'windowsRS5', defaultValue: false, description: 'Windows 2019 (RS5) Build/Test')
|
booleanParam(name: 'windowsRS5', defaultValue: false, description: 'Windows 2019 (RS5) Build/Test')
|
||||||
|
booleanParam(name: 'skip_dco', defaultValue: false, description: 'Skip the DCO check')
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
DOCKER_BUILDKIT = '1'
|
DOCKER_BUILDKIT = '1'
|
||||||
|
@ -24,6 +25,20 @@ pipeline {
|
||||||
TIMEOUT = '120m'
|
TIMEOUT = '120m'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
stage('DCO-check') {
|
||||||
|
when {
|
||||||
|
beforeAgent true
|
||||||
|
expression { !params.skip_dco }
|
||||||
|
}
|
||||||
|
agent { label 'linux' }
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
docker run --rm \
|
||||||
|
-v "$WORKSPACE:/workspace" \
|
||||||
|
alpine sh -c 'apk add --no-cache -q git bash && cd /workspace && hack/validate/dco'
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('unit-validate') {
|
stage('unit-validate') {
|
||||||
|
|
Loading…
Reference in New Issue