#!/bin/bash set -xv LOCAL_GITLAB_GHORG_DIR=${1:-"${HOME}/ghorg"} TOKEN=${2:-'password'} GITLAB_URL=${3:-'http://gitlab.example.com'} # Delete all folders that start with local-gitlab-latest- in the LOCAL_GITLAB_GHORG_DIR for dir in "${LOCAL_GITLAB_GHORG_DIR}"/local-gitlab-*; do if [ -d "$dir" ]; then rm -rf "$dir" fi done # NOTE run all clones twice to test once for clone then pull ## # # #### ##### #### # # ##### #### # # # # # # # # # # # # # # # # # # # ##### # # # # # # # # # #### ###### # # # ### ##### # # # # ##### # # # # # # # # # # # # # # # # # # ###### ###### #### # # #### #### # #### ############ CLONE AND TEST ALL-GROUPS, PRESERVE DIR, OUTPUT DIR, SNIPPETS ############ ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="$TOKEN" --preserve-dir --output-dir=local-gitlab-latest-repos ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="$TOKEN" --preserve-dir --output-dir=local-gitlab-latest-repos GOT=$( ghorg ls local-gitlab-latest-repos/local-gitlab-group1 | grep -o 'local-gitlab-latest-repos/local-gitlab-group1.*') WANT=$(cat <