From a726c38814a58aaf26357441eeff91ceb63dc0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Thu, 22 Aug 2019 22:32:12 +0200 Subject: [PATCH 1/2] Setup for automatic documentation deployment --- .gitlab-ci.yml | 20 ++++++++++++++++++++ Documentation/Doxyfile | 2 +- Documentation/deploy | 15 ++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07be350fc..147c3b42a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ before_script: # same job. stages: - build + - deploy # default flags for cmake .default_cmake_flags_def: &default_cmake_flags @@ -372,3 +373,22 @@ mpi_benchmarks_tools_python_Release: WITH_BENCHMARKS: "yes" WITH_TOOLS: "yes" WITH_PYTHON: "yes" + + +deploy documentation: + stage: deploy + only: + variables: + - $TNL_DOC_DEPLOY_KEY + changes: + - Documentation/**/* + - src/TNL/**/*.{h,hpp} + refs: + - develop + - schedules + - triggers + script: + - ./Documentation/build + - ./Documentation/deploy + tags: + - doxygen diff --git a/Documentation/Doxyfile b/Documentation/Doxyfile index 92c1dd3d0..c660194df 100644 --- a/Documentation/Doxyfile +++ b/Documentation/Doxyfile @@ -1260,7 +1260,7 @@ HTML_COLORSTYLE_GAMMA = 80 # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = NO +HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the diff --git a/Documentation/deploy b/Documentation/deploy index 2c85442bc..e4ba2ce5d 100755 --- a/Documentation/deploy +++ b/Documentation/deploy @@ -13,4 +13,17 @@ cd ${0%/*} [[ ! -d "$OUTPUTDIR" ]] && ./build -rsync -e "ssh -p $SSH_PORT" -P -rvzc --cvs-exclude --delete "$OUTPUTDIR/" "$SSH_USER@$SSH_HOST:$SSH_TARGET_DIR" +# set default arguments for ssh +SSH_ARGS="-p $SSH_PORT" + +# When the script is run from continuous integration, the ssh key should be +# specified by this environment variable. We need to put it into a temporary +# file and pass it to ssh. +if [[ "$TNL_DOC_DEPLOY_KEY" != "" ]]; then + tempfile=$(mktemp) + trap "rm -f $tempfile" EXIT + echo "$TNL_DOC_DEPLOY_KEY" | base64 -d > "$tempfile" + SSH_ARGS="$SSH_ARGS -i $tempfile" +fi + +rsync -e "ssh $SSH_ARGS" -P -rvzc --cvs-exclude --delete "$OUTPUTDIR/" "$SSH_USER@$SSH_HOST:$SSH_TARGET_DIR" -- GitLab From e14a8c7e234a63b8e1101613395146573d92e785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Thu, 22 Aug 2019 23:25:00 +0200 Subject: [PATCH 2/2] CI: automatically skip builds for commits without any changes in the source files --- .gitlab-ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 147c3b42a..0406398c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,6 +72,22 @@ stages: variables: <<: *default_cmake_flags BUILD_TYPE: Debug + only: + changes: + - src/**/*.{h,hpp,cpp,cu} + - Documentation/Tutorials/**/*.{h,hpp,cpp,cu} + - "**/CMakeLists.txt" + +# Dummy build job to ensure that a pipeline is created for a merge request, even +# when there were no changes. +dummy build job: + stage: build + script: echo "dummy" + except: + changes: + - src/**/*.{h,hpp,cpp,cu} + - Documentation/Tutorials/**/*.{h,hpp,cpp,cu} + - "**/CMakeLists.txt" # Cuda builds are specified first because they take more time than host-only builds, # which can be allocated on hosts whitout GPUs. -- GitLab