Skip to content

Commit

Permalink
pipelines: add lint-py to linter pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
refack committed Mar 28, 2019
1 parent 87c4a2c commit 024d423
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 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,25 @@ 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()
echo node_version
def node_version_parts = node_version.tokenize('.')
def node_major = node_version_parts[0] as int
def lint_py3_ret = 0
if (node_major > 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 024d423

Please sign in to comment.