diff --git a/README.md b/README.md index 1b2ca52d..7094e5dc 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host .. Then you can generate the documentation using ```sh -cmake --build . -j +cmake --build . -- Sphinx -j ``` You can find the generated documentation inside the `docs/sphinx` folder inside the build diff --git a/automation/Dockerfile b/automation/Dockerfile index 318619f8..5bd7d382 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -5,16 +5,21 @@ RUN apt-get --yes upgrade #tzdata is a dependency, won't install otherwise ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping +RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz + +RUN python3 -m pip install sphinx breathe RUN git clone https://github.com/catchorg/Catch2.git && \ - cd Catch2 && \ - git checkout v3.1.0 && \ - cmake -Bbuild -H. -DBUILD_TESTING=OFF && \ - cmake --build build/ --target install + cd Catch2 && \ + git checkout v3.1.0 && \ + cmake -Bbuild -H. -DBUILD_TESTING=OFF && \ + cmake --build build/ --target install RUN git clone https://github.com/ETLCPP/etl.git && \ - cd etl && \ - git checkout 20.28.0 && \ - cmake -B build . && \ - cmake --install build/ + cd etl && \ + git checkout 20.28.0 && \ + cmake -B build . && \ + cmake --install build/ + +#ssh needs a valid user to work +RUN adduser --uid 114 jenkins diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 02340190..8b123fa9 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -1,9 +1,13 @@ pipeline { environment { BUILDDIR = 'cmake-build-tests' + DOCDDIR = 'cmake-build-documentation' } agent { - docker { image 'fsfw-ci:d3'} + docker { + image 'fsfw-ci:d5' + args '--network host' + } } stages { stage('Clean') { @@ -39,5 +43,47 @@ pipeline { } } } + stage('Documentation') { + when { + branch 'development' + } + steps { + dir(DOCDDIR) { + sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' + sh 'make Sphinx' + sshagent(credentials: ['documentation-buildfix']) { + sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/development/*' + sh 'scp -o StrictHostKeyChecking=no -r docs/sphinx/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' + } + } + dir(BUILDDIR) { + sshagent(credentials: ['documentation-buildfix']) { + sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/coverage/development/*' + sh 'scp -o StrictHostKeyChecking=no -r fsfw-tests_coverage/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/coverage/development' + } + } + } + } + stage('Master Documentation') { + when { + branch 'master' + } + steps { + dir(DOCDDIR) { + sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' + sh 'make Sphinx' + sshagent(credentials: ['documentation-buildfix']) { + sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/master/*' + sh 'scp -o StrictHostKeyChecking=no -r docs/sphinx/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' + } + } + dir(BUILDDIR) { + sshagent(credentials: ['documentation-buildfix']) { + sh 'ssh -o StrictHostKeyChecking=no buildfix@documentation.intra.irs.uni-stuttgart.de rm -rf /mnt/data/www/html/fsfw/coverage/master/*' + sh 'scp -o StrictHostKeyChecking=no -r fsfw-tests_coverage/* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/coverage/master' + } + } + } + } } }