haproxy/scripts/haproxy-clone.sh
2022-06-05 05:31:53 +01:00

16 lines
313 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SRC_REPO=$1
SRC_BRANCH=$2
OUT_DIR=$3
PARENT_DIR=$(dirname "$OUT_DIR")
[ -d "$PARENT_DIR" ] || mkdir -pv "$(dirname "$PARENT_DIR")"
apt -qq update && apt -qq -y --no-install-recommends install git
git clone "$SRC_REPO" "$OUT_DIR"
git -C "$OUT_DIR" checkout "$SRC_BRANCH"