| 1 |
/* Copyright (C) 2025 Wildfire Games. |
| 2 |
* This file is part of 0 A.D. |
| 3 |
* |
| 4 |
* 0 A.D. is free software: you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation, either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* 0 A.D. is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
*/ |
| 17 |
|
| 18 |
// This pipeline is used to build the documentation. |
| 19 |
|
| 20 |
pipeline { |
| 21 |
agent { |
| 22 |
dockerfile { |
| 23 |
label 'LinuxAgent' |
| 24 |
customWorkspace 'workspace/technical-docs' |
| 25 |
dir 'build/jenkins/dockerfiles' |
| 26 |
filename 'docs-tools.Dockerfile' |
| 27 |
// Prevent Jenkins from running commands with the UID of the host's jenkins user |
| 28 |
// https://stackoverflow.com/a/42822143 |
| 29 |
args '-u root' |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
stages { |
| 34 |
stage('Pull documentation assets') { |
| 35 |
steps { |
| 36 |
sh 'git lfs pull -I docs/doxygen' |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
stage('Engine docs') { |
| 41 |
steps { |
| 42 |
sh 'cd docs/doxygen/ && cmake -S . -B build-docs && cmake --build build-docs' |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
stage('Entity docs') { |
| 47 |
steps { |
| 48 |
sh 'cd binaries/system/ && svn export --force https://svn.wildfiregames.com/nightly-build/trunk/binaries/system/entity.rng' |
| 49 |
sh 'cd source/tools/entdocs/ && ./build.sh' |
| 50 |
sh 'cd source/tools/entdocs/ && mv entity-docs.html nightly.html' |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
stage('Template Analyzer') { |
| 55 |
steps { |
| 56 |
sh 'cd source/tools/templatesanalyzer/ && python3 unit_tables.py' |
| 57 |
sh 'mv source/tools/templatesanalyzer/unit_summary_table.html source/tools/templatesanalyzer/index.html' |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
stage('Upload') { |
| 62 |
steps { |
| 63 |
sshPublisher alwaysPublishFromMaster: true, failOnError: true, publishers: [ |
| 64 |
sshPublisherDesc(configName: 'docs.wildfiregames.com', transfers: [ |
| 65 |
sshTransfer(sourceFiles: 'docs/doxygen/output/html/**', removePrefix: 'docs/doxygen/output/html/', remoteDirectory: 'pyrogenesis'), |
| 66 |
sshTransfer(sourceFiles: 'source/tools/entdocs/nightly.html', removePrefix: 'source/tools/entdocs', remoteDirectory: 'entity-docs'), |
| 67 |
sshTransfer(sourceFiles: 'source/tools/templatesanalyzer/index.html', removePrefix: 'source/tools/templatesanalyzer', remoteDirectory: 'templatesanalyzer'), |
| 68 |
] |
| 69 |
)] |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
} |