From 40a8a2e50e9b92f158a787b2cabd0b76e3226d2b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 31 Jan 2021 13:38:07 -0700 Subject: [PATCH] wrapping up initial cut at new repo manager --- bin/sync_git_repos.py | 19 +++++++-------- install.conf.yaml | 3 --- repos.ini | 56 +++++++++++++++++++------------------------ 3 files changed, 33 insertions(+), 45 deletions(-) diff --git a/bin/sync_git_repos.py b/bin/sync_git_repos.py index 73c8802..6b46b4f 100644 --- a/bin/sync_git_repos.py +++ b/bin/sync_git_repos.py @@ -43,20 +43,15 @@ def sync_workspace(workspace_fp, repos, remote_host, remote_name, callbacks, init_repo(repo, repo_fp, remote, remote_name, callbacks, github_peers) -def setup_callbacks(): - pub_fp = os.path.expanduser('~/.ssh/id_ecdsa.pub') - priv_fp = os.path.expanduser('~/.ssh/id_ecdsa') - keypair = pygit2.Keypair('git', pub_fp, priv_fp, '') - callbacks = pygit2.RemoteCallbacks(credentials=keypair) - return callbacks - - if __name__ == '__main__': ini_fp = sys.argv[1] cfg = configparser.ConfigParser() cfg.read(ini_fp) - callbacks = setup_callbacks() + pub_fp = os.path.expanduser('~/.ssh/id_ecdsa.pub') + priv_fp = os.path.expanduser('~/.ssh/id_ecdsa') + keypair = pygit2.Keypair('git', pub_fp, priv_fp, '') + callbacks = pygit2.RemoteCallbacks(credentials=keypair) for section in cfg.sections(): workspace_fp = cfg[section]['workspace'] @@ -64,12 +59,14 @@ if __name__ == '__main__': repos = cfg[section]['repos'].split(',') repos = [r.strip() for r in repos] + if '' in repos: + repos.remove('') remote_host = cfg[section]['remote_host'] remote_name = cfg[section]['remote_name'] github_peers = cfg[section]['github_peers'].split(',') - if github_peers == ['']: - github_peers = [] + if '' in github_peers: + github_peers.remove('') sync_workspace(workspace_fp, repos, remote_host, remote_name, callbacks, github_peers) diff --git a/install.conf.yaml b/install.conf.yaml index aca7a7e..9ce7eed 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -7,9 +7,6 @@ - ~/projects/mds - ~/projects/personal -- shell: - - python3 bin/bootstrap_git_repos.py - - link: ~/.tmux.conf: tmux.conf ~/.gitconfig: git/gitconfig diff --git a/repos.ini b/repos.ini index d2af60e..f158508 100644 --- a/repos.ini +++ b/repos.ini @@ -1,67 +1,61 @@ [personal] -workspace=~/projects/personal2 +workspace=~/projects/personal remote_host=git@pingo.thermokar.st remote_name=pingo github_peers= repos= - 3dmodels, - advent-of-code-2015, - advent-of-code-2016, akdillon, - akextract, - akindices, aoc2020, + cs685, + dot_ssh, + dotfiles, + elixir-class, + gitolite-admin, + gpx-web-utils, + pingo, + planner, + thermokar.st, + zettel, + +[mds] +workspace=~/projects/mds +remote_host=git@pingo.thermokar.st +remote_name=pingo +github_peers= +repos= arctic_hibernators_schema, bactdb, bactdb_data, ccdb-api, ccdb-old, ccdb-web, - cs425_anch_tax_data_loader, - cs425_anch_tax_map_app, - cs680_aes, - cs680_aes_report, - cs685, - dot_ssh, - dotfiles, drf_ember_pagination, - elixir-class, - fpjs, - gitolite-admin, - gpx-web-utils, hibernators, hibernators-web, hymenobacterdotinfo, - jwt, - pingo, - planner, - qzv-view, - stem2017, - thermokar.st, - zettel [github_thermokast_personal] -workspace=~/projects/personal2 +workspace=~/projects/personal remote_host=git@github.com/thermokarst remote_name=thermokarst github_peers= repos= - thermokarst + thermokarst, [github_thermokarst_qiime2] -workspace=~/projects/qiime22 +workspace=~/projects/qiime2 remote_host=git@github.com/thermokarst remote_name=thermokarst github_peers= repos= + q2-no-op, workflows-playground, - q2-no-op [github_thermokarst_forks_qiime2] -workspace=~/projects/qiime22 +workspace=~/projects/qiime2 remote_host=git@github.com/thermokarst-forks remote_name=thermokarst -github_peers=ebolyen,gregcaporaso,ChrisKeefe,Oddant1,nbokulich,andrewsanchez +github_peers=ebolyen,gregcaporaso,ChrisKeefe,Oddant1,nbokulich,andrewsanchez,cherman2 repos= An-Introduction-To-Applied-Bioinformatics, Keemei, @@ -129,4 +123,4 @@ repos= view.qiime2.org, vm-playbooks, workshop-playbooks, - workshops + workshops,