ESBO-ETC/Jenkinsfile
LukasK13 b880027a2a
All checks were successful
esbo_ds/ESBO-ETC/pipeline/head This commit looks good
path fixed for autdoc
2020-07-21 14:21:19 +02:00

50 lines
1.5 KiB
Groovy

pipeline {
agent none
environment {
SPHINX_DIR = 'docs'
BUILD_DIR = 'build/html'
SOURCE_DIR = 'source'
}
stages {
stage('Build') {
agent {
dockerfile {
filename "Dockerfile"
args "-u root" //needed to get around permission issues
}
}
steps {
// Install dependencies
sh '''
virtualenv pyenv
. pyenv/bin/activate
pip3 install -r requirements.txt
'''
// clear out old files
sh 'rm -rf ${BUILD_DIR}'
sh 'rm -f ${SPHINX_DIR}/sphinx-build.log'
sh '''
pyenv/bin/sphinx-build \
-w ${SPHINX_DIR}/sphinx-build.log \
-b html ${SPHINX_DIR}/${SOURCE_DIR} ${SPHINX_DIR}/${BUILD_DIR}
'''
stash includes: 'docs/build/html/**/*.*', name: 'html'
}
post {
failure {
sh 'cat ${SPHINX_DIR}/sphinx-build.log'
}
}
}
stage('Deploy') {
agent {
label 'lunjaserv'
}
steps {
unstash 'html'
sh 'rm -rf /opt/esbo-etc/html/*'
sh 'cp -rf docs/build/html /opt/esbo-etc/'
}
}
}
}