diff --git a/Jenkinsfile b/Jenkinsfile index 74608ef9..3bb6b070 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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'){