mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
9da7b2ec8d
Adding options to Jenkins pipline builds
71 lines
2.3 KiB
Plaintext
71 lines
2.3 KiB
Plaintext
pipeline {
|
|
agent { label 'pr-lint-slave' }
|
|
options {
|
|
timestamps()
|
|
ansiColor('xterm')
|
|
}
|
|
environment {
|
|
PYENV_ROOT = "/usr/local/pyenv"
|
|
PATH = "$PYENV_ROOT/bin:$PATH"
|
|
PY_COLORS = 1
|
|
}
|
|
stages {
|
|
stage('github-pending') {
|
|
steps {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'Testing lint...',
|
|
status: 'PENDING',
|
|
context: "jenkins/pr/lint"
|
|
}
|
|
}
|
|
stage('setup') {
|
|
steps {
|
|
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 tox'
|
|
}
|
|
}
|
|
stage('linting') {
|
|
failFast false
|
|
parallel {
|
|
stage('salt linting') {
|
|
steps {
|
|
sh 'eval "$(pyenv init -)"; tox -e pylint-salt | tee pylint-report.xml'
|
|
archiveArtifacts artifacts: 'pylint-report.xml'
|
|
}
|
|
}
|
|
stage('test linting') {
|
|
steps {
|
|
sh 'eval "$(pyenv init -)"; tox -e pylint-tests | tee pylint-report-tests.xml'
|
|
archiveArtifacts artifacts: 'pylint-report-tests.xml'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
step([$class: 'WarningsPublisher',
|
|
parserConfigurations: [[
|
|
parserName: 'PyLint',
|
|
pattern: 'pylint-report*.xml'
|
|
]],
|
|
failedTotalAll: '1',
|
|
usePreviousBuildAsReference: true
|
|
])
|
|
cleanWs()
|
|
}
|
|
success {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'The lint job has passed',
|
|
status: 'SUCCESS',
|
|
context: "jenkins/pr/lint"
|
|
}
|
|
failure {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'The lint job has failed',
|
|
status: 'FAILURE',
|
|
context: "jenkins/pr/lint"
|
|
}
|
|
}
|
|
}
|