From 003a6d00fa5cca7450f9bab77244ee2b99106fe2 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 13:13:18 +0200 Subject: [PATCH 01/16] Documentation build tools in docker --- automation/Dockerfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/automation/Dockerfile b/automation/Dockerfile index 318619f8..81e3e14a 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -5,16 +5,18 @@ 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/ \ No newline at end of file From 92e3ab04f3eaf0b560195407b94d772bd63c4956 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 13:54:23 +0200 Subject: [PATCH 02/16] testing Jenkinsfile --- automation/Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 02340190..8cdf68aa 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -1,9 +1,10 @@ pipeline { environment { BUILDDIR = 'cmake-build-tests' + DOCDDIR = 'cmake-build-documentation' } agent { - docker { image 'fsfw-ci:d3'} + docker { image 'fsfw-ci:d4'} } stages { stage('Clean') { @@ -39,5 +40,17 @@ pipeline { } } } + stage('Documentation') { + steps { + dir(DOCDDIR) { + sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' + sh 'make Sphinx' + sh 'cd docs/sphinx' + sshagent(credentials: ['documentation-buildfix']) { + sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' + } + } + } + } } } From d79b5348d85ab4415f985fa1ef0275b5097d753e Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:00:36 +0200 Subject: [PATCH 03/16] testing Jenkinsfile --- automation/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 8cdf68aa..dcd98d5b 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -47,6 +47,7 @@ pipeline { sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { + sh 'ssh -vvv buildfix@documents.intra.irs.uni-stuttgart.de uname -a' sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' } } From 8bbde054136bb61c63f1f0715994efa552f2620b Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:08:04 +0200 Subject: [PATCH 04/16] add jenkins user in docker so that ssh will work --- automation/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/automation/Dockerfile b/automation/Dockerfile index 81e3e14a..ce7088fb 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -19,4 +19,7 @@ RUN git clone https://github.com/ETLCPP/etl.git && \ cd etl && \ git checkout 20.28.0 && \ cmake -B build . && \ - cmake --install build/ \ No newline at end of file + cmake --install build/ + +#ssh needs a valid user to work +RUN adduser -m -u 114 jenkins From ecf51b29139953c25e2347b41dcd648b0ceddb43 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:09:08 +0200 Subject: [PATCH 05/16] testing Jenkinsfile --- automation/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index dcd98d5b..6bc5b0a6 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { DOCDDIR = 'cmake-build-documentation' } agent { - docker { image 'fsfw-ci:d4'} + docker { image 'fsfw-ci:d5'} } stages { stage('Clean') { @@ -42,6 +42,7 @@ pipeline { } stage('Documentation') { steps { + echo env.BRANCH_NAME dir(DOCDDIR) { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' From 9c7248e78e38659005b082b9946211c5a868684d Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:20:30 +0200 Subject: [PATCH 06/16] typo in Dockerfile --- automation/Dockerfile | 2 +- automation/Jenkinsfile | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/automation/Dockerfile b/automation/Dockerfile index ce7088fb..5bd7d382 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -22,4 +22,4 @@ RUN git clone https://github.com/ETLCPP/etl.git && \ cmake --install build/ #ssh needs a valid user to work -RUN adduser -m -u 114 jenkins +RUN adduser --uid 114 jenkins diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 6bc5b0a6..54b21b36 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -41,18 +41,34 @@ pipeline { } } stage('Documentation') { + when { + branch 'development' + } steps { - echo env.BRANCH_NAME dir(DOCDDIR) { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'ssh -vvv buildfix@documents.intra.irs.uni-stuttgart.de uname -a' sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' } } } } + stage('Master Documentation') { + when { + branch 'master' + } + steps { + dir(DOCDDIR) { + sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' + sh 'make Sphinx' + sh 'cd docs/sphinx' + sshagent(credentials: ['documentation-buildfix']) { + sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' + } + } + } + } } } From 9bd600c4882415f2c0d2a083d60403fdebeb88f8 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:32:10 +0200 Subject: [PATCH 07/16] testing Jenkinsfile --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 54b21b36..3dfc083a 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -42,7 +42,7 @@ pipeline { } stage('Documentation') { when { - branch 'development' + branch 'mohr/documentation_ci' } steps { dir(DOCDDIR) { From 8e835be55fe088e6fba19cc98a12d109f8071a57 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:46:12 +0200 Subject: [PATCH 08/16] testing Jenkinsfile --- automation/Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 3dfc083a..84133c43 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -4,7 +4,10 @@ pipeline { DOCDDIR = 'cmake-build-documentation' } agent { - docker { image 'fsfw-ci:d5'} + docker { + image 'fsfw-ci:d5' + args '--network host' + } } stages { stage('Clean') { @@ -41,6 +44,7 @@ pipeline { } } stage('Documentation') { + agent any when { branch 'mohr/documentation_ci' } @@ -50,7 +54,7 @@ pipeline { sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' + sh 'scp -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' } } } From fa5605c959fef28b285d26ed074439774fb5373d Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 14:50:37 +0200 Subject: [PATCH 09/16] testing Jenkinsfile --- automation/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 84133c43..8deeb994 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -44,7 +44,6 @@ pipeline { } } stage('Documentation') { - agent any when { branch 'mohr/documentation_ci' } @@ -69,7 +68,7 @@ pipeline { sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -r ./* buildfix@documents.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' + sh 'scp -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' } } } From 6451a16888fb2a465dd4fcaff7fe49fc7ab352b7 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 17:51:01 +0200 Subject: [PATCH 10/16] fixing scp command --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 8deeb994..d3bb31be 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -68,7 +68,7 @@ pipeline { sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' + sh 'scp -o StrictHostKeyChecking=no -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/master' } } } From 24ecf125a3979f77baa502fbbabacaf94d262c99 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 17:55:12 +0200 Subject: [PATCH 11/16] fixing scp command again --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index d3bb31be..5fe38b03 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -53,7 +53,7 @@ pipeline { sh 'make Sphinx' sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' + sh 'scp -o StrictHostKeyChecking=no -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/mnt/data/www/html/fsfw/development' } } } From f34cf9095dbe72a865881af1267b2e4523917295 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 18:02:38 +0200 Subject: [PATCH 12/16] fixing scp yet again --- automation/Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 5fe38b03..3095a27c 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -51,9 +51,8 @@ pipeline { dir(DOCDDIR) { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' - sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -o StrictHostKeyChecking=no -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/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' } } } @@ -66,9 +65,8 @@ pipeline { dir(DOCDDIR) { sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..' sh 'make Sphinx' - sh 'cd docs/sphinx' sshagent(credentials: ['documentation-buildfix']) { - sh 'scp -o StrictHostKeyChecking=no -r ./* buildfix@documentation.intra.irs.uni-stuttgart.de:/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' } } } From 3257935150a26dcca09282c04fbc432738cd6831 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 18:06:16 +0200 Subject: [PATCH 13/16] fixing scp yet again again --- automation/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 3095a27c..ac0f54be 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -52,6 +52,7 @@ pipeline { 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' } } @@ -66,6 +67,7 @@ pipeline { 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' } } From 21a9d89fb36a9838961b9d9b3e6137b67af665a2 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 18:14:26 +0200 Subject: [PATCH 14/16] pushing code coverage report to documentation server --- automation/Jenkinsfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index ac0f54be..cc61a320 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -56,6 +56,12 @@ pipeline { 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') { @@ -71,6 +77,12 @@ pipeline { 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' + } + } } } } From af282c7d3ee9e9e2d5f6b0d03e411a267b6115c9 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 18:17:56 +0200 Subject: [PATCH 15/16] reverting to only publish development --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index cc61a320..8b123fa9 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { } stage('Documentation') { when { - branch 'mohr/documentation_ci' + branch 'development' } steps { dir(DOCDDIR) { From 6970068d568bd693282ddd7fef066bd8a9dc6ecc Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 13 Sep 2022 18:19:35 +0200 Subject: [PATCH 16/16] small fix in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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