Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Generate script to clone all the repos in a collection of Stash projects.
- ```
- import sys
- import os
- import stashy
- BITBUCKET_URL=""
- BITBUCKET_USER=""
- BITBUCKET_PASSWORD=""
- projects = []
- stash = stashy.connect(BITBUCKET_URL,BITBUCKET_USER,BITBUCKET_PASSWORD)
- for project in projects:
- print("mkdir -p %s" % project)
- print("cd %s" % project)
- for repo in stash.projects[project].repos.list():
- for url in repo["links"]["clone"]:
- if (url["name"] == "ssh"):
- print("git clone %s" % url["href"])
- break
- print("cd ..")
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement