Clean up
Some checks failed
esbo_ds/ESBO-ETC/pipeline/head There was a failure building this commit

This commit is contained in:
Lukas Klass 2020-07-22 08:13:28 +02:00
parent 5c2f46e84d
commit d6eaed389b

22
Jenkinsfile vendored
View File

@ -11,19 +11,19 @@ pipeline {
agent { agent {
dockerfile { dockerfile {
filename "Dockerfile" filename "Dockerfile"
args "-u root" //needed to get around permission issues
} }
} }
steps { steps {
// Install dependencies // Install dependencies
sh ''' sh '''
virtualenv pyenv virtualenv venv
. pyenv/bin/activate . venv/bin/activate
pip3 install -r requirements.txt pip3 install -r requirements.txt
''' '''
// run tests
sh ''' sh '''
export PYTHONPATH=`pwd` export PYTHONPATH=`pwd`
pyenv/bin/python3 -m unittest discover test venv/bin/python3 -m unittest discover ${TEST_DIR}
''' '''
} }
} }
@ -32,24 +32,25 @@ pipeline {
agent { agent {
dockerfile { dockerfile {
filename "Dockerfile" filename "Dockerfile"
args "-u root" //needed to get around permission issues
} }
} }
steps { steps {
// Install dependencies // Install dependencies
sh ''' sh '''
virtualenv pyenv virtualenv venv
. pyenv/bin/activate . venv/bin/activate
pip3 install -r requirements.txt pip3 install -r requirements.txt
''' '''
// clear out old files // clear out old files
sh 'rm -rf ${BUILD_DIR}' sh 'rm -rf ${BUILD_DIR}'
sh 'rm -f ${SPHINX_DIR}/sphinx-build.log' sh 'rm -f ${SPHINX_DIR}/sphinx-build.log'
// build docs
sh ''' sh '''
pyenv/bin/sphinx-build \ venv/bin/sphinx-build \
-w ${SPHINX_DIR}/sphinx-build.log \ -w ${SPHINX_DIR}/sphinx-build.log \
-b html ${SPHINX_DIR}/${SOURCE_DIR} ${SPHINX_DIR}/${BUILD_DIR} -b html ${SPHINX_DIR}/${SOURCE_DIR} ${SPHINX_DIR}/${BUILD_DIR}
''' '''
// stash build result
stash includes: 'docs/build/html/**/*.*', name: 'html' stash includes: 'docs/build/html/**/*.*', name: 'html'
} }
post { post {
@ -58,13 +59,16 @@ pipeline {
} }
} }
} }
stage('Deploy') { stage('Deploy Docs') {
agent { agent {
label 'lunjaserv' label 'lunjaserv'
} }
steps { steps {
// unstash build results from previous stage
unstash 'html' unstash 'html'
// remove old files
sh 'rm -rf /opt/esbo-etc/html/*' sh 'rm -rf /opt/esbo-etc/html/*'
// copy new files
sh 'cp -rf docs/build/html /opt/esbo-etc/' sh 'cp -rf docs/build/html /opt/esbo-etc/'
} }
} }