From 01e4e887e075ac0113291c326f274abd711c7a56 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 5 Feb 2024 15:51:39 +0000 Subject: [PATCH 1/5] .gitlab-ci.yml: Remove useless manual job Remove manual job since it's not any easier to trigger from GitLab UI. --- .gitlab-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 776056bf8..bfb738401 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -148,9 +148,3 @@ Autobranch: keepgoing update_branch for-preview-autobranch preview preview-force exit $ret - -Autobranch-manual: - needs: ['Autobranch'] - when: manual - allow_failure: false # Set to false to return to the previous behavior. - script: exit 0 -- GitLab From a1fc7988e566662eda5f265ae2c08ccd4a3c52f4 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 5 Feb 2024 15:55:01 +0000 Subject: [PATCH 2/5] .gitlab-ci.yml: Update the variable names --- .gitlab-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bfb738401..4942ef000 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,22 +24,22 @@ default: # Required for Manual runs through UI variables: - ENABLE_TEST: - value: "False" + WEB_ENABLE_TEST: + value: "True" options: - "True" - "False" - description: True to run test job. Defaults to false. - ENABLE_AUTOBRANCH: - value: "False" + description: True to run test job when triggered via Web UI. + WEB_ENABLE_AUTOBRANCH: + value: "True" options: - "True" - "False" - description: True to run Autobranch job. Defaults to false. Autobranch is allowed only on main. + description: True to run test job when triggered via Web UI. Test: rules: - - if: $CI_PIPELINE_SOURCE == "web" && $ENABLE_TEST == "True" + - if: $CI_PIPELINE_SOURCE == "web" && $WEB_ENABLE_TEST == "True" - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH parallel: @@ -73,7 +73,7 @@ Autobranch: # request branch for safety reasons. GIT_STRATEGY: none rules: - - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $ENABLE_AUTOBRANCH == "True" + - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $WEB_ENABLE_AUTOBRANCH == "True" - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /(^|,)autobranch($|,)/ resource_group: autobranch -- GitLab From 0859e6508536f942c43e24a102a871d2ff4ac1f8 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 5 Feb 2024 16:45:07 +0000 Subject: [PATCH 3/5] .gitlab-ci.yml: Avoid cloning in tmpfs --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4942ef000..206587eb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,6 +84,10 @@ Autobranch: - sudo apt-get install -y tzdata git python3.10-full - | + # Avoid using /tmp since it's probably in tmpfs and would consume RAM + export TMPDIR=$(readlink -f .)/tmp + mkdir -p "$TMPDIR" + origin_repo=$(mktemp -d) git clone -b "$CI_DEFAULT_BRANCH" "$CI_REPOSITORY_URL" "$origin_repo" -- GitLab From 5966ce5d5a9db911d533df00b708eb2893a97bf4 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 5 Feb 2024 16:55:51 +0000 Subject: [PATCH 4/5] .gitlab-ci.yml: Use reliable packages --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 206587eb0..e13b168d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,7 +81,7 @@ Autobranch: - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update -y - sudo apt-get upgrade -y - - sudo apt-get install -y tzdata git python3.10-full + - sudo apt-get install -y git python3-full - | # Avoid using /tmp since it's probably in tmpfs and would consume RAM -- GitLab From 04ed1c57af0c9dad08970396e28bbc9e1b696f70 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 5 Feb 2024 17:16:49 +0000 Subject: [PATCH 5/5] .gitlab-ci.yml: Add GitLab pages conf --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e13b168d7..30e7168ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,3 +152,34 @@ Autobranch: keepgoing update_branch for-preview-autobranch preview preview-force exit $ret + + +pages: + needs: ['Autobranch', 'Test'] + resource_group: pages + + artifacts: + paths: + - doc/public + publish: doc/public + + rules: + - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + + before_script: + - PYVERSION=10 + - sudo sh -c 'echo "APT::Acquire::Retries=3;" >> /etc/apt/apt.conf.d/99retry-downloads' + - export DEBIAN_FRONTEND=noninteractive + - sudo apt-get update -y + - sudo apt-get upgrade -y + - sudo apt-get -y install python3.${PYVERSION}-full + - echo "$(python3 --version)" + + script: + - export LISA_PYTHON=python3.${PYVERSION} + - sudo ./install_base.sh --install-doc-extras + - source init_env + - | + set -e + cd doc/ + sphinx-build -b html . "public/$CI_COMMIT_BRANCH" -- GitLab