wrapping up initial cut at new repo manager

This commit is contained in:
Matthew Ryan Dillon 2021-01-31 13:38:07 -07:00
parent 5e6ada58ae
commit 40a8a2e50e
3 changed files with 33 additions and 45 deletions

View file

@ -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) 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__': if __name__ == '__main__':
ini_fp = sys.argv[1] ini_fp = sys.argv[1]
cfg = configparser.ConfigParser() cfg = configparser.ConfigParser()
cfg.read(ini_fp) 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(): for section in cfg.sections():
workspace_fp = cfg[section]['workspace'] workspace_fp = cfg[section]['workspace']
@ -64,12 +59,14 @@ if __name__ == '__main__':
repos = cfg[section]['repos'].split(',') repos = cfg[section]['repos'].split(',')
repos = [r.strip() for r in repos] repos = [r.strip() for r in repos]
if '' in repos:
repos.remove('')
remote_host = cfg[section]['remote_host'] remote_host = cfg[section]['remote_host']
remote_name = cfg[section]['remote_name'] remote_name = cfg[section]['remote_name']
github_peers = cfg[section]['github_peers'].split(',') github_peers = cfg[section]['github_peers'].split(',')
if github_peers == ['']: if '' in github_peers:
github_peers = [] github_peers.remove('')
sync_workspace(workspace_fp, repos, remote_host, sync_workspace(workspace_fp, repos, remote_host,
remote_name, callbacks, github_peers) remote_name, callbacks, github_peers)

View file

@ -7,9 +7,6 @@
- ~/projects/mds - ~/projects/mds
- ~/projects/personal - ~/projects/personal
- shell:
- python3 bin/bootstrap_git_repos.py
- link: - link:
~/.tmux.conf: tmux.conf ~/.tmux.conf: tmux.conf
~/.gitconfig: git/gitconfig ~/.gitconfig: git/gitconfig

View file

@ -1,67 +1,61 @@
[personal] [personal]
workspace=~/projects/personal2 workspace=~/projects/personal
remote_host=git@pingo.thermokar.st remote_host=git@pingo.thermokar.st
remote_name=pingo remote_name=pingo
github_peers= github_peers=
repos= repos=
3dmodels,
advent-of-code-2015,
advent-of-code-2016,
akdillon, akdillon,
akextract,
akindices,
aoc2020, 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, arctic_hibernators_schema,
bactdb, bactdb,
bactdb_data, bactdb_data,
ccdb-api, ccdb-api,
ccdb-old, ccdb-old,
ccdb-web, ccdb-web,
cs425_anch_tax_data_loader,
cs425_anch_tax_map_app,
cs680_aes,
cs680_aes_report,
cs685,
dot_ssh,
dotfiles,
drf_ember_pagination, drf_ember_pagination,
elixir-class,
fpjs,
gitolite-admin,
gpx-web-utils,
hibernators, hibernators,
hibernators-web, hibernators-web,
hymenobacterdotinfo, hymenobacterdotinfo,
jwt,
pingo,
planner,
qzv-view,
stem2017,
thermokar.st,
zettel
[github_thermokast_personal] [github_thermokast_personal]
workspace=~/projects/personal2 workspace=~/projects/personal
remote_host=git@github.com/thermokarst remote_host=git@github.com/thermokarst
remote_name=thermokarst remote_name=thermokarst
github_peers= github_peers=
repos= repos=
thermokarst thermokarst,
[github_thermokarst_qiime2] [github_thermokarst_qiime2]
workspace=~/projects/qiime22 workspace=~/projects/qiime2
remote_host=git@github.com/thermokarst remote_host=git@github.com/thermokarst
remote_name=thermokarst remote_name=thermokarst
github_peers= github_peers=
repos= repos=
q2-no-op,
workflows-playground, workflows-playground,
q2-no-op
[github_thermokarst_forks_qiime2] [github_thermokarst_forks_qiime2]
workspace=~/projects/qiime22 workspace=~/projects/qiime2
remote_host=git@github.com/thermokarst-forks remote_host=git@github.com/thermokarst-forks
remote_name=thermokarst remote_name=thermokarst
github_peers=ebolyen,gregcaporaso,ChrisKeefe,Oddant1,nbokulich,andrewsanchez github_peers=ebolyen,gregcaporaso,ChrisKeefe,Oddant1,nbokulich,andrewsanchez,cherman2
repos= repos=
An-Introduction-To-Applied-Bioinformatics, An-Introduction-To-Applied-Bioinformatics,
Keemei, Keemei,
@ -129,4 +123,4 @@ repos=
view.qiime2.org, view.qiime2.org,
vm-playbooks, vm-playbooks,
workshop-playbooks, workshop-playbooks,
workshops workshops,