diff --git a/2 b/2 deleted file mode 100644 index 765755e..0000000 --- a/2 +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# -# Initialize dadi staging folder from repository -# -# - delete existing dadi staging folder -# - -HTML_HOME="/html" -BRANCHES_FOLDER="/html/branches" -DADI_STAGING_REPOSITORY="git_dadi-staging:AG-IT/KlDaDiSeite.git" - -# -# Remove all branch folders -# - -for dir in "$BRANCHES_FOLDER"/*/; do - dir_name=$(basename "$dir") - - echo "Deleting directory: $dir" - rm -rf "$dir" -done - -# -# Fetch all branch names -# -branches=() -while read -r ref; do - # Extract branch name from the reference - branch_name=$(echo "$ref" | awk '{print $2}' | sed 's/refs\/heads\///') - - # put into array - branches+=("$branch_name") -done < <(git ls-remote --heads "$DADI_STAGING_REPOSITORY") - -for branch in "${branches[@]}"; do - echo "cloning $branch" - git clone --depth 1 --branch "$branch" --single-branch "$DADI_STAGING_REPOSITORY" "$BRANCHES_FOLDER"/"$branch" -done