Created
August 20, 2014 10:22
-
-
Save fmartingr/4385efd123caebf56ad8 to your computer and use it in GitHub Desktop.
python script to clone all codebase repositories using codebase-api and fabric into a codebase exported data folder
This file contains 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 characters
# pip install codebase-api fabric | |
from codebase import CodebaseClient | |
from fabric.operations import local | |
CLIENT_ID = 'foo/bar' | |
CLIENT_KEY = 'key' | |
client = CodebaseClient(CLIENT_ID, CLIENT_KEY) | |
projects = client.all_projects() | |
for project in projects: | |
print("===> {}".format(project)) | |
repositories = client.repositories(project) | |
for repo in repositories: | |
print("- {}".format(repo)) | |
repo_details = client.repository(project, repo) | |
clone_url = repo_details['clone_url'] | |
local('git clone {} {}/clones/{}'.format(clone_url, project, repo)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment