diff --git a/scripts/local-gitlab/clone.sh b/scripts/local-gitlab/integration-tests.sh similarity index 68% rename from scripts/local-gitlab/clone.sh rename to scripts/local-gitlab/integration-tests.sh index 5102bac..d39d888 100755 --- a/scripts/local-gitlab/clone.sh +++ b/scripts/local-gitlab/integration-tests.sh @@ -8,11 +8,20 @@ LOCAL_GITLAB_GHORG_DIR=${3:-"${HOME}/Desktop/ghorg"} export GHORG_INSECURE_GITLAB_CLIENT=true -############ ############ -############ CLONE AND TEST ALL-GROUPS PRESERVING DIRECTORY STRUCTURE ############ -############ ############ +# NOTE run all clones twice to test once for clone then pull -# run twice, once for clone then pull + + + ## # # #### ##### #### # # ##### #### + # # # # # # # # # # # # # # # + # # # # ##### # # # # # # # # # #### + ###### # # # ### ##### # # # # ##### # + # # # # # # # # # # # # # # # + # # ###### ###### #### # # #### #### # #### + + + +############ CLONE AND TEST ALL-GROUPS, PRESERVE DIR, OUTPUT DIR ############ ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="$TOKEN" --preserve-dir --output-dir=local-gitlab-v15-repos ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="$TOKEN" --preserve-dir --output-dir=local-gitlab-v15-repos @@ -27,7 +36,7 @@ EOF if [ "${WANT}" != "${GOT}" ] then -echo "ALL_GROUPS GROUP1 PRESERVE DIR TEST FAILED" +echo "CLONE AND TEST ALL-GROUPS, PRESERVE DIR, OUTPUT DIR TEST FAILED" exit 1 fi @@ -42,7 +51,7 @@ EOF if [ "${WANT}" != "${GOT}" ] then -echo "ALL_GROUPS GROUP2 PRESERVE DIR TEST FAILED" +echo "CLONE AND TEST ALL-GROUPS, PRESERVE DIR, OUTPUT DIR TEST FAILED" exit 1 fi @@ -58,14 +67,11 @@ EOF if [ "${WANT}" != "${GOT}" ] then -echo "ALL_GROUPS GROUP3/SUBGROUP-A PRESERVE DIR TEST FAILED" +echo "CLONE AND TEST ALL-GROUPS, PRESERVE DIR, OUTPUT DIR TEST FAILED" exit 1 fi -############ ############ -############ CLONE AND TEST ALL-GROUPS ############ -############ ############ - +############ CLONE AND TEST ALL-GROUPS, OUTPUT DIR ############ ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-repos-flat ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-repos-flat @@ -93,26 +99,69 @@ EOF if [ "${WANT}" != "${GOT}" ] then -echo "ALL_GROUPS FLAT TEST FAILED" +echo "CLONE AND TEST ALL-GROUPS, OUTPUT DIR" exit 1 fi -ghorg clone root --clone-type=user --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-root-user-repos --prune --prune-no-confirm -ghorg clone root --clone-type=user --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-root-user-repos --prune --prune-no-confirm - +############ CLONE ALL-GROUPS, BACKUP, CLONE WIKI, OUTPUT DIR ############ ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --backup --clone-wiki --output-dir=local-gitlab-v15-backup ghorg clone all-groups --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --backup --clone-wiki --output-dir=local-gitlab-v15-backup + ##### ### # # ##### # ####### # # ##### ####### ###### + # # # ## # # # # # # # # # # # # + # # # # # # # # # # # # # # + ##### # # # # # #### # ##### # # ##### ##### ###### + # # # # # # # # # # # # # # # + # # # # ## # # # # # # # # # # # + ##### ### # # ##### ####### ####### ##### ##### ####### # # + + +############ CLONE SINGLE USER, OUTPUT DIR, PRUNE, PRUNE NO CONFIRM ############ +ghorg clone root --clone-type=user --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-root-user-repos --prune --prune-no-confirm +ghorg clone root --clone-type=user --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-root-user-repos --prune --prune-no-confirm + + ####### ####### ###### # ####### # # ####### # ##### ###### ####### # # ###### + # # # # # # # # # # # # # # # # # # # # # + # # # # # # # # # # # # # # # # # # # # + # # # ###### # ##### # # ##### # # #### ###### # # # # ###### + # # # # # # # # # # # # # # # # # # # + # # # # # # # # # # # # # # # # # # # + # ####### # ####### ####### # ####### ####### ##### # # ####### ##### # + + +############ CLONE TOP LEVEL GROUP, BACKUP, OUTPUT DIR ############ ghorg clone local-gitlab-group1 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --backup --output-dir=local-gitlab-v15-group1-backup ghorg clone local-gitlab-group1 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --backup --output-dir=local-gitlab-v15-group1-backup +############ CLONE TOP LEVEL GROUP, OUTPUT DIR ############ ghorg clone local-gitlab-group1 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-group1 ghorg clone local-gitlab-group1 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --output-dir=local-gitlab-v15-group1 -############ ############ -############ CLONE AND TEST GROUP WITH SUBGROUP AND PRESERVE DIR ############ -############ ############ +############ CLONE AND TEST TOP LEVEL GROUP ############ +ghorg clone local-gitlab-group3 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" +ghorg clone local-gitlab-group3 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" +GOT=$(ghorg ls local-gitlab-group3 | grep -o 'local-gitlab-group3.*') +WANT=$(cat <