mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
71 lines
2.1 KiB
Plaintext
71 lines
2.1 KiB
Plaintext
pipeline {
|
|
agent {
|
|
label 'docs'
|
|
}
|
|
options {
|
|
timestamps()
|
|
ansiColor('xterm')
|
|
timeout(time: 2, unit: 'HOURS')
|
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
|
}
|
|
environment {
|
|
PYENV_ROOT = "/usr/local/pyenv"
|
|
PATH = "$PYENV_ROOT/bin:$PATH"
|
|
PY_COLORS = 1
|
|
SPHINXOPTS = "-W"
|
|
}
|
|
stages {
|
|
stage('github-pending') {
|
|
steps {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'Testing docs...',
|
|
status: 'PENDING',
|
|
context: "jenkins/pr/docs"
|
|
}
|
|
}
|
|
stage('setup') {
|
|
steps {
|
|
sh '''
|
|
eval "$(pyenv init -)"
|
|
pyenv --version
|
|
pyenv install --skip-existing 3.6.8
|
|
pyenv shell 3.6.8
|
|
python --version
|
|
pip install -U https://github.com/s0undt3ch/nox/archive/hotfix/py2.zip#egg=Nox==2018.10.17
|
|
nox --version
|
|
'''
|
|
}
|
|
}
|
|
stage('build') {
|
|
steps {
|
|
sh '''
|
|
eval "$(pyenv init -)"
|
|
pyenv shell 3.6.8
|
|
nox -e docs
|
|
'''
|
|
archiveArtifacts artifacts: 'doc/doc-archive.tar.gz'
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
cleanWs()
|
|
}
|
|
success {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'The docs job has passed',
|
|
status: 'SUCCESS',
|
|
context: "jenkins/pr/docs"
|
|
}
|
|
failure {
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
description: 'The docs job has failed',
|
|
status: 'FAILURE',
|
|
context: "jenkins/pr/docs"
|
|
slackSend channel: "#jenkins-prod-pr",
|
|
color: '#FF0000',
|
|
message: "FAILED: PR-Job: '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
|
|
}
|
|
}
|
|
}
|