From a18a38f94f019614d58371c649a4098f2980aecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Fri, 23 Aug 2019 10:09:40 +0200 Subject: [PATCH 1/2] CI: split build and deploy documentation, use artifacts --- .gitlab-ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeec91716..2ea7be08b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -393,20 +393,34 @@ mpi_benchmarks_tools_python_Release: WITH_PYTHON: "yes" + + +build documentation: + stage: build + only: + changes: + - Documentation/**/* + - src/TNL/**/*.{h,hpp} + script: + - ./Documentation/build + artifacts: + paths: + - ./Documentation/html/ + tags: + - doxygen + deploy documentation: stage: deploy only: variables: - $TNL_DOC_DEPLOY_KEY - changes: - - Documentation/**/* - - src/TNL/**/*.{h,hpp} refs: - develop - schedules - triggers + dependencies: + - build documentation script: - - ./Documentation/build - ./Documentation/deploy tags: - doxygen -- GitLab From 20d895015ce27fb06096ef304d122d2c2643ada4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Fri, 23 Aug 2019 10:35:36 +0200 Subject: [PATCH 2/2] Documentation: added git commit id to the header --- Documentation/Doxyfile | 4 +++- Documentation/build | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/Doxyfile b/Documentation/Doxyfile index c660194df..22f50041a 100644 --- a/Documentation/Doxyfile +++ b/Documentation/Doxyfile @@ -37,8 +37,10 @@ PROJECT_NAME = "Template Numerical Library" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. +# We pass the value from the build script using an environment variable, see +# https://stackoverflow.com/a/54487043 -PROJECT_NUMBER = 0.1 +PROJECT_NUMBER = $(PROJECT_NUMBER) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Documentation/build b/Documentation/build index de2b0a39a..a516bfbe1 100755 --- a/Documentation/build +++ b/Documentation/build @@ -30,8 +30,12 @@ done # Remove existing html/ directory which may contain old files rm -rf ./html/ +# Assemble environment variables which are used in the Doxyfile +#PROJECT_NUMBER="version $(git branch --show-current):$(git log -1 --format="%h (%cd)")" +PROJECT_NUMBER="version $(git branch --show-current):$(git rev-parse --short HEAD)" + # Generate documentation -doxygen +PROJECT_NUMBER="$PROJECT_NUMBER" doxygen # Install if [[ "$INSTALL" == "yes" ]]; then -- GitLab