Browse code

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>
(cherry picked from commit d6f7909c7639105c93e0670999e6f0536e9f6fff)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/08/12 00:26:26
Showing 1 changed files
... ...
@@ -14,6 +14,7 @@ pipeline {
14 14
         booleanParam(name: 'powerpc', defaultValue: true, description: 'PowerPC (ppc64le) Build/Test')
15 15
         booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test')
16 16
         booleanParam(name: 'windowsRS5', defaultValue: false, description: 'Windows 2019 (RS5) Build/Test')
17
+        booleanParam(name: 'skip_dco', defaultValue: false, description: 'Skip the DCO check')
17 18
     }
18 19
     environment {
19 20
         DOCKER_BUILDKIT     = '1'
... ...
@@ -24,6 +25,20 @@ pipeline {
24 24
         TIMEOUT             = '120m'
25 25
     }
26 26
     stages {
27
+        stage('DCO-check') {
28
+            when {
29
+                beforeAgent true
30
+                expression { !params.skip_dco }
31
+            }
32
+            agent { label 'linux' }
33
+            steps {
34
+                sh '''
35
+                docker run --rm \
36
+                  -v "$WORKSPACE:/workspace" \
37
+                  alpine sh -c 'apk add --no-cache -q git bash && cd /workspace && hack/validate/dco'
38
+                '''
39
+            }
40
+        }
27 41
         stage('Build') {
28 42
             parallel {
29 43
                 stage('unit-validate') {