Skip to content

Commit

Permalink
pipelines: add lint-py to liter pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
refack committed Mar 27, 2019
1 parent 87c4a2c commit 2e75cd2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions jenkins/pipelines/node-linter.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipeline {
userRemoteConfigs: [[
credentialsId: "96d5f81c-e9ad-45f7-ba5d-bc8107c0ae2c",
url: "[email protected]:${params.GITHUB_ORG}/${params.REPO_NAME}",
refspec: "+refs/heads/*:refs/remotes/origin/* +${params.GIT_REMOTE_REF}:refs/remotes/origin/_jenkins_local_branch"
refspec: "+${params.GIT_REMOTE_REF}:refs/remotes/origin/_jenkins_local_branch"
]]
])
}
Expand All @@ -42,15 +42,22 @@ pipeline {
steps {
// Calling with `returnStatus` suppresses automatic failures
sh(script: "${env.MAKE} lint-md-build", returnStatus: true)
sh(script: "${env.MAKE} lint-py-build", returnStatus: true)
}
}

stage('Run tests') {
steps {
script {
def node_version = sh(script: "python tools/getnodeversion.py", returnStdout: true).trim()
def lint_py3_ret = 0
if (node_version > '11') {
// this job does not build node, so we use the system's node
lint_py3_ret = sh(script: "NODE=node PYTHON=python3 ${env.MAKE} lint-py", returnStatus: true)
}
// this job does not build node, so we use the system's node
def ret = sh(script: "NODE=node ${env.MAKE} lint-ci", returnStatus: true)
if (ret != 0) {
if (ret != 0 || lint_py3_ret != 0) {
echo(extractErrors())
error('lint failed - open above section for details')
}
Expand Down

0 comments on commit 2e75cd2

Please sign in to comment.