Skip to content

Commit e6f8757

Browse files
committed
ci(jenkins): lint commits stage in parallel
1 parent 2175914 commit e6f8757

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

Jenkinsfile

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,6 @@ pipeline {
5454
}
5555
}
5656
}
57-
/**
58-
Lint commit messages
59-
*/
60-
stage('Lint commit messages') {
61-
agent { label 'docker && immutable' }
62-
options { skipDefaultCheckout() }
63-
environment {
64-
HOME = "${env.WORKSPACE}"
65-
}
66-
steps {
67-
withGithubNotify(context: 'Lint Commit Messages') {
68-
deleteDir()
69-
unstash 'source'
70-
script {
71-
docker.image('node:12').inside("-v ${WORKSPACE}/${BASE_DIR}:/app"){
72-
sh(label: "Basic tests", script: 'cd /app && .ci/scripts/lint-commits.sh')
73-
}
74-
}
75-
}
76-
}
77-
}
7857
/**
7958
Run tests.
8059
*/
@@ -107,6 +86,9 @@ pipeline {
10786
parallelTasksWithoutAsyncHooks["Node.js-${version}-async-hooks-false"] = generateStep(version: version)
10887
}
10988

89+
// Linting the commit message in parallel with the test stage
90+
parallelTasks['Commit lint'] = lintCommits()
91+
11092
env.ELASTIC_APM_ASYNC_HOOKS = "true"
11193
parallel(parallelTasks)
11294

@@ -354,3 +336,21 @@ def getSmartTAVContext() {
354336
}
355337
return context
356338
}
339+
340+
def lintCommits(){
341+
return {
342+
node('docker && linux && immutable') {
343+
catchError(stageResult: 'UNSTABLE', message: 'Lint Commit Messages failures') {
344+
withGithubNotify(context: 'Lint Commit Messages') {
345+
deleteDir()
346+
unstash 'source'
347+
script {
348+
docker.image('node:12').inside("-v ${WORKSPACE}/${BASE_DIR}:/app"){
349+
sh(label: 'Lint commits', script: 'cd /app && .ci/scripts/lint-commits.sh')
350+
}
351+
}
352+
}
353+
}
354+
}
355+
}
356+
}

0 commit comments

Comments
 (0)