|
|
|
@ -33,8 +33,12 @@ gitlabClient = getGitlabClient()
|
|
|
|
|
# migrate repos
|
|
|
|
|
reposToMigrate = []
|
|
|
|
|
|
|
|
|
|
projects = gitlabClient.projects.list(
|
|
|
|
|
search_namespaces=True, search="bluerock", iterator=True)
|
|
|
|
|
print("Loading repositories from Gitlab ...")
|
|
|
|
|
#projects = gitlabClient.projects.list(
|
|
|
|
|
# search_namespaces=True, search="max", iterator=True)
|
|
|
|
|
user = gitlabClient.users.list(username='fenoglio')[0]
|
|
|
|
|
projects = user.projects.list()
|
|
|
|
|
|
|
|
|
|
for project in projects:
|
|
|
|
|
#print(project)
|
|
|
|
|
#print(project.namespace['path'], project.name, project.visibility, project.http_url_to_repo)
|
|
|
|
@ -76,5 +80,17 @@ for project in projects:
|
|
|
|
|
reposToMigrate.append(migration)
|
|
|
|
|
|
|
|
|
|
for repo in reposToMigrate:
|
|
|
|
|
print("Migrating", repo['clone_addr'], "to owner", repo["repo_owner"], "with name", repo['repo_name'])
|
|
|
|
|
try:
|
|
|
|
|
existingRepo = repositoryApi.repo_get(repo["repo_owner"], repo['repo_name'])
|
|
|
|
|
skip = not existingRepo.empty
|
|
|
|
|
except gitea.rest.ApiException as e:
|
|
|
|
|
if e.status == 404:
|
|
|
|
|
skip = False
|
|
|
|
|
else:
|
|
|
|
|
raise e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Migrating", repo['clone_addr'], "to owner", repo["repo_owner"], "with name", repo['repo_name'], "[SKIPPED]" if skip else "")
|
|
|
|
|
if skip:
|
|
|
|
|
continue
|
|
|
|
|
repositoryApi.repo_migrate(body=repo)
|
|
|
|
|