Skip to content

Commit

Permalink
[pre-commit] for linting merge-conflict, pipelines and JJBB (#28501) (#…
Browse files Browse the repository at this point in the history
…28537)

(cherry picked from commit 0a24250)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
  • Loading branch information
mergify[bot] and v1v authored Oct 20, 2021
1 parent f3fd137 commit 4183504
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict

- repo: https://github.com/elastic/apm-pipeline-library.git
rev: current
hooks:
- id: check-jenkins-pipelines
files: ^(.ci/(.*\.groovy|Jenkinsfile)|Jenkinsfile)$
- id: check-jjbb
16 changes: 15 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,24 @@ def runLinting() {
}
}
mapParallelTasks['default'] = { cmd(label: 'make check-default', script: 'make check-default') }

mapParallelTasks['pre-commit'] = runPreCommit()
parallel(mapParallelTasks)
}

def runPreCommit() {
return {
withNode(labels: 'ubuntu-18 && immutable', forceWorkspace: true){
withGithubNotify(context: 'Check pre-commit', tab: 'tests') {
deleteDir()
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${BASE_DIR}"){
preCommit(commit: "${GIT_BASE_COMMIT}", junit: true)
}
}
}
}
}

def runBuildAndTest(Map args = [:]) {
def filterStage = args.get('filterStage', 'mandatory')
deleteDir()
Expand Down

0 comments on commit 4183504

Please sign in to comment.