Guest User

Untitled

a guest
Jul 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/bin/bash
  2. # Documentation
  3. # https://docs.gitlab.com/ce/api/projects.html#list-projects
  4. NAMESPACE="ms"
  5. BASE_PATH="https://gitlab.com/"
  6. PROJECT_SELECTION="select(.namespace.name == "$NAMESPACE")"
  7.  
  8. read -p "Are you connected to git in ssh ? " -n 1 -r
  9. echo # (optional) move to a new line
  10. if [[ $REPLY =~ ^[Yy]$ ]]
  11. then
  12. PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
  13. else
  14. PROJECT_PROJECTION="{ "path": .path, "git": .http_url_to_repo }"
  15. fi
  16.  
  17.  
  18. if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then
  19. echo "Please set the environment variable GITLAB_PRIVATE_TOKEN"
  20. echo "See ${BASE_PATH}profile/account"
  21. exit 1
  22. fi
Add Comment
Please, Sign In to add comment