progress
This commit is contained in:
@ -38,6 +38,16 @@ class Migrator:
|
||||
|
||||
self.__logger = logger
|
||||
|
||||
def _get_repo_api(self, hostname, port, token):
|
||||
|
||||
conf = giteapy.Configuration()
|
||||
conf.api_key['access_token'] = token
|
||||
conf.host = self._make_api_base(hostname=hostname, port=port)
|
||||
conf.verify_ssl = self.__verify_ssl
|
||||
api = giteapy.RepositoryApi(giteapy.ApiClient(conf))
|
||||
|
||||
return api
|
||||
|
||||
def _get_org_apis(self):
|
||||
|
||||
api_source = self._get_org_api(
|
||||
@ -170,6 +180,17 @@ class Migrator:
|
||||
description=repo.description,
|
||||
labels=True, issues=True, pull_requests=True, releases=True, milestones=True, wiki=True
|
||||
)
|
||||
migrate_body.auth_token = self.__source_token
|
||||
migrate_body.swagger_types["auth_token"] = "str"
|
||||
migrate_body.attribute_map["auth_token"] = "auth_token"
|
||||
|
||||
self.__logger.info("Migrate body:")
|
||||
self.__logger.info(migrate_body)
|
||||
|
||||
destination_api = self._get_repo_api(
|
||||
hostname=self.__destination_host,
|
||||
port=self.__destination_port,
|
||||
token=self.__destination_token,
|
||||
)
|
||||
migration_result = destination_api.repo_migrate(body=migrate_body)
|
||||
self.__logger.info(f"Migration result: {migration_result}")
|
||||
|
Reference in New Issue
Block a user