def _add_repository(self, dest, repository_identifier, creator, create_repo): repository_identifier = format_repository_identifier( repository_identifier) # sys.exit() proot = os.path.join(paths.repository_dataset_dir, repository_identifier) if not os.path.isdir(proot): # create new local repo os.mkdir(proot) repo = GitRepoManager() repo.open_repo(proot) repo.add_ignore('.DS_Store') self.repo_man = repo if create_repo: # add repo to central location create_github_repo(repository_identifier) url = 'https://github.com/{}/{}.git'.format( ORG, repository_identifier) self.debug('Create repo at github. url={}'.format(url)) repo.create_remote(url) else: repo = GitRepoManager() repo.open_repo(proot) dbexp = dest.get_repository(repository_identifier) if not dbexp: dest.add_repository(repository_identifier, creator) return repo
def _add_repository(self, dest, repository_identifier, creator, create_repo): repository_identifier = format_repository_identifier(repository_identifier) # sys.exit() proot = os.path.join(paths.repository_dataset_dir, repository_identifier) if not os.path.isdir(proot): # create new local repo os.mkdir(proot) repo = GitRepoManager() repo.open_repo(proot) repo.add_ignore('.DS_Store') self.repo_man = repo if create_repo: # add repo to central location create_github_repo(repository_identifier) url = 'https://github.com/{}/{}.git'.format(ORG, repository_identifier) self.debug('Create repo at github. url={}'.format(url)) repo.create_remote(url) else: repo = GitRepoManager() repo.open_repo(proot) dbexp = dest.get_repository(repository_identifier) if not dbexp: dest.add_repository(repository_identifier, creator) return repo
def create_repo_for_existing_local(repo_identifier, root, organization='NMGRLData'): from pychron.git_archive.repo_manager import GitRepoManager repo = GitRepoManager() proot = os.path.join(root, repo_identifier) repo.open_repo(proot) org = Organization(organization) if not org.has_repo(repo_identifier): usr = os.environ.get('GITHUB_USER') pwd = os.environ.get('GITHUB_PASSWORD') org.create_repo(repo_identifier, usr, pwd) url = 'https://github.com/{}/{}.git'.format(organization, repo_identifier) repo.create_remote(url)
def create_repo_for_existing_local(repo_identifier, root, organization='NMGRLData'): from pychron.git_archive.repo_manager import GitRepoManager repo = GitRepoManager() proot = os.path.join(root, repo_identifier) repo.open_repo(proot) org = Organization(organization) if not org.has_repo(repo_identifier): usr = os.environ.get('GITHUB_USER') pwd = os.environ.get('GITHUB_PASSWORD') org.create_repo(repo_identifier, usr, pwd) url = 'https://github.com/{}/{}.git'.format(organization, repo_identifier) repo.create_remote(url)