2018-06-11 20:53:37 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'lint' }
|
|
|
|
environment {
|
|
|
|
PYENV_ROOT = "/usr/local/pyenv"
|
|
|
|
PATH = "$PYENV_ROOT/bin:$PATH"
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('pylint setup') {
|
|
|
|
steps {
|
2018-06-11 22:57:55 +00:00
|
|
|
sh 'pwd'
|
2018-06-11 20:53:37 +00:00
|
|
|
sh 'eval "$(pyenv init -)"; pyenv install 2.7.14 || echo "We already have this python."; pyenv local 2.7.14; pyenv shell 2.7.14'
|
|
|
|
sh 'eval "$(pyenv init -)"; pip install pylint SaltPyLint'
|
|
|
|
sh 'eval "$(pyenv init -)"; which pylint; pylint --version'
|
|
|
|
}
|
|
|
|
}
|
2018-06-11 22:57:55 +00:00
|
|
|
stage('linting') {
|
|
|
|
failFast false
|
|
|
|
parallel {
|
|
|
|
stage('salt linting') {
|
|
|
|
steps {
|
|
|
|
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W1307,str-format-in-logging setup.py salt/ | tee pylint-report.xml'
|
|
|
|
archiveArtifacts artifacts: 'pylint-report.xml'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('test linting') {
|
|
|
|
steps {
|
|
|
|
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W0232,E1002,W1307,str-format-in-logging tests/ | tee pylint-report-tests.xml'
|
|
|
|
archiveArtifacts artifacts: 'pylint-report-tests.xml'
|
|
|
|
}
|
|
|
|
}
|
2018-06-11 20:53:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
success {
|
|
|
|
githubNotify description: "The lint job has passed", status: "SUCCESS"
|
|
|
|
}
|
|
|
|
failure {
|
|
|
|
githubNotify description: "The lint job has failed", status: "FAILURE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|