From 3044813f977a08c05ecdc3de2355ff91cf8058c2 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 18 Jan 2024 14:27:57 +0100 Subject: [PATCH] ci: avoid sudo requirement for self-hosted cirrus --- .cirrus.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index ef465456c738d..6011bad605e85 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -45,6 +45,9 @@ env: # Global defaults # - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory. # - noble: For a machine running the Linux kernel shipped with exaclty Ubuntu Noble 24.04. The machine is recommended to have 4 CPUs and 16 GB of memory. # - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory. +# +# For works without sudo rights, start them with USER_MODE=true and make sure: +# - git is installed # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks filter_template: &FILTER_TEMPLATE @@ -60,7 +63,8 @@ base_template: &BASE_TEMPLATE << : *FILTER_TEMPLATE merge_base_script: # Unconditionally install git (used in fingerprint_script). - - bash -c "$PACKAGE_MANAGER_INSTALL git" + # In USER_MODE this must have been done manually + - if [ ! "$USER_MODE" = "true" ]; then bash -c "$PACKAGE_MANAGER_INSTALL git"; fi - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi - git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge" - git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts