Last active
April 16, 2017 09:18
-
-
Save numb95/e136e77870c23374c66f21b5513c990c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import requests | |
import json | |
import os | |
url = "https://gitlab.com/api/v4/groups/GROUPNAME/projects?per_page=100" | |
headers = { | |
'private-token': "TOKEN_GET_FROM_GITLAB" | |
} | |
response = requests.request("GET", url, headers=headers) | |
parsed_json = json.loads(response.text) | |
for i in parsed_json: | |
os.system("mkdir /root/backup/" + i["name"]) | |
os.system("git clone " + i["ssh_url_to_repo"] + " /root/backup/" + i["name"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment