Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Generate script to clone all the repos in a collection of Stash projects.
  2.  
  3. ```
  4. import sys
  5. import os
  6. import stashy
  7.  
  8. BITBUCKET_URL=""
  9. BITBUCKET_USER=""
  10. BITBUCKET_PASSWORD=""
  11.  
  12. projects = []
  13.  
  14. stash = stashy.connect(BITBUCKET_URL,BITBUCKET_USER,BITBUCKET_PASSWORD)
  15.  
  16. for project in projects:
  17. print("mkdir -p %s" % project)
  18. print("cd %s" % project)
  19.  
  20. for repo in stash.projects[project].repos.list():
  21. for url in repo["links"]["clone"]:
  22. if (url["name"] == "ssh"):
  23. print("git clone %s" % url["href"])
  24. break
  25.  
  26. print("cd ..")
  27. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement