Skip to content

Commit

Permalink
ci: simplify jenkins Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Oct 24, 2024
1 parent d43643a commit e8c89fb
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -316,66 +316,66 @@ pipeline {
booleanParam(name: 'DEPLOY_DOCS', defaultValue: false, description: 'Update online documentation')
}
stages {
// stage('Build Sphinx Documentation'){
// agent {
// docker{
// image 'sphinxdoc/sphinx-latexpdf'
// label 'linux && docker && x86'
// }
// }
// options {
// retry(conditions: [agent()], count: 2)
// }
// environment{
// PIP_CACHE_DIR = '/tmp/pipcache'
// UV_INDEX_STRATEGY = 'unsafe-best-match'
// UV_TOOL_DIR = '/tmp/uvtools'
// UV_PYTHON_INSTALL_DIR = '/tmp/uvpython'
// UV_CACHE_DIR = '/tmp/uvcache'
// UV_PYTHON = '3.11'
// }
// steps {
// catchError(buildResult: 'UNSTABLE', message: 'Sphinx has warnings', stageResult: 'UNSTABLE') {
// sh(label: 'Build docs in html and Latex formats',
// script:'''python3 -m venv venv
// trap "rm -rf venv" EXIT
// . ./venv/bin/activate
// pip install uv
// uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b html -d build/docs/.doctrees -w logs/build_sphinx_html.log docs/source build/docs/html
// uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b latex -d build/docs/.doctrees docs/source build/docs/latex
// ''')
// sh(label: 'Building PDF docs',
// script: '''make -C build/docs/latex
// mkdir -p dist/docs
// mv build/docs/latex/*.pdf dist/docs/
// '''
// )
// }
// }
// post{
// always{
// recordIssues(tools: [sphinxBuild(pattern: 'logs/build_sphinx_html.log')])
// }
// success{
// stash includes: 'dist/docs/*.pdf', name: 'SPEEDWAGON_DOC_PDF'
// zip archive: true, dir: 'build/docs/html', glob: '', zipFile: "dist/${props.name}-${props.version}.doc.zip"
// stash includes: 'dist/*.doc.zip,build/docs/html/**', name: 'DOCS_ARCHIVE'
// archiveArtifacts artifacts: 'dist/docs/*.pdf'
// }
// cleanup{
// cleanWs(
// notFailBuild: true,
// deleteDirs: true,
// patterns: [
// [pattern: 'logs/', type: 'INCLUDE'],
// [pattern: 'venv/', type: 'INCLUDE'],
// [pattern: 'dist/', type: 'INCLUDE'],
// [pattern: 'build/', type: 'INCLUDE'],
// ]
// )
// }
// }
// }
stage('Build Sphinx Documentation'){
agent {
docker{
image 'sphinxdoc/sphinx-latexpdf'
label 'linux && docker && x86'
}
}
options {
retry(conditions: [agent()], count: 2)
}
environment{
PIP_CACHE_DIR = '/tmp/pipcache'
UV_INDEX_STRATEGY = 'unsafe-best-match'
UV_TOOL_DIR = '/tmp/uvtools'
UV_PYTHON_INSTALL_DIR = '/tmp/uvpython'
UV_CACHE_DIR = '/tmp/uvcache'
UV_PYTHON = '3.11'
}
steps {
catchError(buildResult: 'UNSTABLE', message: 'Sphinx has warnings', stageResult: 'UNSTABLE') {
sh(label: 'Build docs in html and Latex formats',
script:'''python3 -m venv venv
trap "rm -rf venv" EXIT
. ./venv/bin/activate
pip install uv
uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b html -d build/docs/.doctrees -w logs/build_sphinx_html.log docs/source build/docs/html
uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b latex -d build/docs/.doctrees docs/source build/docs/latex
''')
sh(label: 'Building PDF docs',
script: '''make -C build/docs/latex
mkdir -p dist/docs
mv build/docs/latex/*.pdf dist/docs/
'''
)
}
}
post{
always{
recordIssues(tools: [sphinxBuild(pattern: 'logs/build_sphinx_html.log')])
}
success{
stash includes: 'dist/docs/*.pdf', name: 'SPEEDWAGON_DOC_PDF'
zip archive: true, dir: 'build/docs/html', glob: '', zipFile: "dist/${props.name}-${props.version}.doc.zip"
stash includes: 'dist/*.doc.zip,build/docs/html/**', name: 'DOCS_ARCHIVE'
archiveArtifacts artifacts: 'dist/docs/*.pdf'
}
cleanup{
cleanWs(
notFailBuild: true,
deleteDirs: true,
patterns: [
[pattern: 'logs/', type: 'INCLUDE'],
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: 'dist/', type: 'INCLUDE'],
[pattern: 'build/', type: 'INCLUDE'],
]
)
}
}
}
stage('Checks'){
stages{
stage('Code Quality'){
Expand Down

0 comments on commit e8c89fb

Please sign in to comment.