mirror of
https://github.com/deadcxap/init_scripts.git
synced 2026-07-02 05:43:40 +03:00
git clone доработка - авторизация, spare чекаут
This commit is contained in:
@@ -268,7 +268,13 @@ setup_role() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
run "Cloning role repository" git clone --depth=1 "$REPO_URL" "$TEMP_DIR"
|
# run "Cloning role repository" git clone --depth=1 "$REPO_URL" "$TEMP_DIR"
|
||||||
|
run "Cloning role repository (sparse)" bash -c "
|
||||||
|
git --config-env=http.https://github.com/.extraheader=GH_AUTH_HEADER \
|
||||||
|
clone --depth=1 --filter=blob:none --sparse "$REPO_URL" "$TEMP_DIR" &&
|
||||||
|
git -C "$TEMP_DIR" sparse-checkout set "$ROLE"
|
||||||
|
"
|
||||||
|
|
||||||
ROLE_SRC="$TEMP_DIR/$ROLE"
|
ROLE_SRC="$TEMP_DIR/$ROLE"
|
||||||
if [[ ! -d "$ROLE_SRC" ]]; then
|
if [[ ! -d "$ROLE_SRC" ]]; then
|
||||||
log "WARN: role directory $ROLE_SRC not found after clone, skipping"
|
log "WARN: role directory $ROLE_SRC not found after clone, skipping"
|
||||||
|
|||||||
Reference in New Issue
Block a user