Skip to content

Commit

Permalink
ci: avoid sudo requirement for self-hosted cirrus
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Jan 18, 2024
1 parent 5b656b9 commit 3044813
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .cirrus.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3044813

Please sign in to comment.