-
-
Save Snger/62ff1bfb3f8dfdf5da0ec852394909fd to your computer and use it in GitHub Desktop.
Revisions
-
JonasGroeger revised this gist
Dec 19, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ fi FILENAME="repos.json" trap "{ rm -f $FILENAME; }" EXIT curl -s "${BASE_PATH}api/v3/projects?private_token=$GITLAB_PRIVATE_TOKEN&search=$PROJECT_SEARCH_PARAM&per_page=999" \ | jq --raw-output --compact-output ".[] | $PROJECT_SELECTION | $PROJECT_PROJECTION" > "$FILENAME" @@ -35,4 +35,4 @@ while read repo; do fi done < "$FILENAME" wait -
JonasGroeger revised this gist
Dec 19, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,9 +28,11 @@ while read repo; do if [ ! -d "$THEPATH" ]; then echo "Cloning $THEPATH ( $GIT )" git clone "$GIT" --quiet & else echo "Pulling $THEPATH" (cd "$THEPATH" && git pull --quiet) & fi done < "$FILENAME" wait -
JonasGroeger revised this gist
Dec 19, 2016 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,8 @@ NAMESPACE="YOUR_NAMESPACE" BASE_PATH="https://gitlab.example.com/" PROJECT_SEARCH_PARAM="" PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")" PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }" if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then echo "Please set the environment variable GITLAB_PRIVATE_TOKEN" @@ -15,8 +17,10 @@ fi FILENAME="repos.json" trap "{ rm -f $FILENAME; exit 255; }" EXIT curl -s "${BASE_PATH}api/v3/projects?private_token=$GITLAB_PRIVATE_TOKEN&search=$PROJECT_SEARCH_PARAM&per_page=999" \ | jq --raw-output --compact-output ".[] | $PROJECT_SELECTION | $PROJECT_PROJECTION" > "$FILENAME" while read repo; do THEPATH=$(echo "$repo" | jq -r ".path") @@ -30,5 +34,3 @@ while read repo; do (cd "$THEPATH" && git pull --quiet) fi done < "$FILENAME" -
JonasGroeger revised this gist
Dec 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ NAMESPACE="YOUR_NAMESPACE" BASE_PATH="https://gitlab.example.com/" PROJECT_SEARCH_PARAM="" if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then echo "Please set the environment variable GITLAB_PRIVATE_TOKEN" -
JonasGroeger revised this gist
Dec 12, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ fi FILENAME="repos.json" curl -s "${BASE_PATH}api/v3/projects?private_token=$GITLAB_PRIVATE_TOKEN&search=$PROJECT_SEARCH_PARAM&per_page=999" \ | jq --raw-output --compact-output ".[] | select(.namespace.name == \"$NAMESPACE\") | { "path": .path, "git": .ssh_url_to_repo }" > "$FILENAME" while read repo; do @@ -24,7 +24,7 @@ while read repo; do if [ ! -d "$THEPATH" ]; then echo "Cloning $THEPATH ( $GIT )" (git clone "$GIT" --quiet) else echo "Pulling $THEPATH" (cd "$THEPATH" && git pull --quiet) -
JonasGroeger renamed this gist
Sep 28, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JonasGroeger created this gist
Sep 28, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/usr/bin/env bash # Documentation # https://docs.gitlab.com/ce/api/projects.html#list-projects NAMESPACE="YOUR_NAMESPACE" BASE_PATH="https://gitlab.example.com/" PROJECT_SEARCH_PARAM="YOUR_SEARCH_PARAM" if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then echo "Please set the environment variable GITLAB_PRIVATE_TOKEN" echo "See ${BASE_PATH}profile/account" exit 1 fi FILENAME="repos.json" curl -s "${BASE_PATH}api/v3/projects?private_token=$GITLAB_PRIVATE_TOKEN&search=$PROJECT_SEARCH_PARAM" \ | jq --raw-output --compact-output ".[] | select(.namespace.name == \"$NAMESPACE\") | { "path": .path, "git": .ssh_url_to_repo }" > "$FILENAME" while read repo; do THEPATH=$(echo "$repo" | jq -r ".path") GIT=$(echo "$repo" | jq -r ".git") if [ ! -d "$THEPATH" ]; then echo "Cloning $THEPATH ( $GIT )" git clone "$GIT" --quiet else echo "Pulling $THEPATH" (cd "$THEPATH" && git pull --quiet) fi done < "$FILENAME" rm "$FILENAME"