Skip to content

Commit fa91bf2

Browse files
author
MarcoFalke
committed
ci: Skip git install if it is already installed
This also avoids the sudo requirement for self-hosted CI runners.
1 parent c65fde4 commit fa91bf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.cirrus.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env: # Global defaults
2222
# - The ./ci/ depedencies (with cirrus-cli) should be installed:
2323
#
2424
# ```
25-
# apt update && apt install screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
25+
# apt update && apt install git screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
2626
# ```
2727
#
2828
# - There are no strict requirements on the hardware, because having less CPUs
@@ -55,7 +55,7 @@ base_template: &BASE_TEMPLATE
5555
<< : *FILTER_TEMPLATE
5656
merge_base_script:
5757
# Unconditionally install git (used in fingerprint_script).
58-
- bash -c "$PACKAGE_MANAGER_INSTALL git"
58+
- git --version || bash -c "$PACKAGE_MANAGER_INSTALL git"
5959
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
6060
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
6161
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts

0 commit comments

Comments
 (0)