From 9642b458ee02404bddc17521602ea69e8840b342 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Mon, 22 Jan 2024 15:53:43 +0100 Subject: [PATCH] test: support installing git-lfs in different environments and only if necessary Signed-off-by: Reuben Miller --- tests/RobotFramework/bin/setup.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/RobotFramework/bin/setup.sh b/tests/RobotFramework/bin/setup.sh index 34a2f7fbb30..e88cab51573 100755 --- a/tests/RobotFramework/bin/setup.sh +++ b/tests/RobotFramework/bin/setup.sh @@ -14,8 +14,22 @@ pushd "$SCRIPT_DIR/.." >/dev/null || exit 1 export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring # Use git lfs for test artefacts -curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash -sudo apt install -y git-lfs +if ! git lfs env >/dev/null 2>&1; then + # install git-lfs dependency, try proceeding anyway if a package manager is not found + if command -V apt-get >/dev/null 2>&1; then + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash + sudo apt-get install -y --no-install-recommends git-lfs + elif command -V yum 2>/dev/null 2>&1; then + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash + sudo yum install -y git-lfs + elif command -V dnf 2>/dev/null 2>&1; then + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash + sudo dnf install -y git-lfs + elif command -V brew >/dev/null 2>&1; then + brew install git-lfs + fi +fi + git lfs install git lfs pull