Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Documentation
- # https://docs.gitlab.com/ce/api/projects.html#list-projects
- NAMESPACE="ms"
- BASE_PATH="https://gitlab.com/"
- PROJECT_SELECTION="select(.namespace.name == "$NAMESPACE")"
- read -p "Are you connected to git in ssh ? " -n 1 -r
- echo # (optional) move to a new line
- if [[ $REPLY =~ ^[Yy]$ ]]
- then
- PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
- else
- PROJECT_PROJECTION="{ "path": .path, "git": .http_url_to_repo }"
- fi
- if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then
- echo "Please set the environment variable GITLAB_PRIVATE_TOKEN"
- echo "See ${BASE_PATH}profile/account"
- exit 1
- fi
Add Comment
Please, Sign In to add comment