1
0
forked from 0ad/0ad

Generate technical docs from CI/CD

- Generate entity.rng as part of the nightly build
- Generate docs from a checkout of the nightly build
- Publish them to docs.wildfiregames.com
This commit is contained in:
Nicolas Auvray 2024-09-24 18:36:43 +02:00
parent 9c72741e69
commit dd7734e73d
Signed by: Itms
GPG Key ID: C7E52BD14CE14E09
3 changed files with 44 additions and 36 deletions

View File

@ -0,0 +1,10 @@
FROM debian:latest
ARG DEBIAN_FRONTEND=noninteractive
ARG DEBCONF_NOWARNINGS="yes"
RUN apt-get -qqy update && apt-get install -qqy --no-install-recommends \
cmake \
doxygen \
graphviz \
subversion \
&& apt-get clean

View File

@ -78,6 +78,12 @@ pipeline {
}
}
stage("Generate entity XML schema") {
steps {
bat "cd binaries\\system && pyrogenesis.exe -mod=public -dumpSchema"
}
}
stage("Check-in SPIRV generation rules") {
when {
expression { env.spirv_rules_FILENAME }

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -19,61 +19,53 @@
pipeline {
agent {
node {
label 'LinuxSlave'
dockerfile {
label 'LinuxAgent'
customWorkspace "workspace/technical-docs"
dir 'build/jenkins/dockerfiles'
filename "docs-tools.Dockerfile"
}
}
options {
checkoutToSubdirectory 'git'
}
stages {
stage("Setup") {
stage("Nightly checkout") {
steps {
sh "sudo zfs clone zpool0/gcc7@latest zpool0/entity-docs"
svn "https://svn.wildfiregames.com/nightly-build/trunk"
}
}
stage("Engine docs") {
steps {
ws("/zpool0/entity-docs"){
sh "cd docs/doxygen/ && doxygen config"
}
}
}
stage("Build") {
steps {
ws("/zpool0/entity-docs"){
sh "build/workspaces/update-workspaces.sh --disable-atlas --without-tests -j1"
sh "cd build/workspaces/gcc/ && make pyrogenesis -j1"
}
sh "cd docs/doxygen/ && doxygen config"
}
}
stage("Entity docs") {
steps {
ws("/zpool0/entity-docs"){
sh "cd binaries/system/ && ./pyrogenesis -mod=public -dumpSchema"
sh "cd source/tools/entdocs/ && ./build.sh"
}
sh "cd source/tools/entdocs/ && ./build.sh"
sh "mv tools/entdocs/entity-docs.html tools/entdocs/nightly.html"
}
}
stage("Template Analyzer") {
steps {
ws("/zpool0/entity-docs"){
sh "cd source/tools/templatesanalyzer/ && python3 unit_tables.py"
}
sh "cd source/tools/templatesanalyzer/ && python3 unit_tables.py"
sh "mv source/tools/templatesanalyzer/unit_summary_table.html source/tools/templatesanalyzer/index.html"
}
}
stage("Upload") {
steps {
ws("/zpool0/entity-docs"){
sh "rsync -rti --delete-after --progress docs/doxygen/html/ docs.wildfiregames.com:~/www/pyrogenesis/"
sh "rsync -ti --progress source/tools/entdocs/entity-docs.html docs.wildfiregames.com:~/www/entity-docs/trunk.html"
sh "rsync -ti --progress source/tools/templatesanalyzer/unit_summary_table.html docs.wildfiregames.com:~/www/templatesanalyzer/index.html"
}
}
}
}
post {
always {
ws("/zpool0/trunk") {
sleep 10
sh "sudo zfs destroy zpool0/entity-docs"
sshPublisher alwaysPublishFromMaster: true, failOnError: true, publishers: [
sshPublisherDesc(configName: 'docs.wildfiregames.com', transfers: [
sshTransfer(sourceFiles: 'docs/doxygen/html/**', removePrefix: 'docs/doxygen/html', remoteDirectory: 'pyrogenesis'),
sshTransfer(sourceFiles: 'tools/entdocs/nightly.html', removePrefix: 'tools/entdocs', remoteDirectory: 'entity-docs'),
sshTransfer(sourceFiles: 'source/tools/templatesanalyzer/index.html', removePrefix: 'source/tools/templatesanalyzer', remoteDirectory: 'templatesanalyzer'),
]
)]
}
}
}