From 82b970a105f02f15cafd57236d4d3d0f411a73f7 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 30 Jun 2021 20:05:19 -0700 Subject: [PATCH] maint: adding new rust project, gwar --- README.md | 5 +- bin/sync_git_repos.py | 76 -------------- repos.ini | 172 -------------------------------- repos.toml | 226 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 229 insertions(+), 250 deletions(-) delete mode 100644 bin/sync_git_repos.py delete mode 100644 repos.ini create mode 100644 repos.toml diff --git a/README.md b/README.md index fd65a07..c679009 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # dotfiles ```bash +$ wget -O gwar https://github.com/thermokarst/gwar/releases/download/0.0.1/gwar-macos +$ chmod +x gwar +$ ./gwar ~/.dotfiles/repos.toml $ git clone --origin pingo ssh://git@pingo.thermokar.st/dotfiles ~/.dotfiles $ git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell $ git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" @@ -38,8 +41,6 @@ $ sudo sh Miniconda3-latest-MacOSX-x86_64.sh -p /opt/miniconda3 -b $ sudo conda update conda $ wget https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py38-osx-conda.yml $ conda env create -n q2dev --file qiime2-latest-py38-osx-conda.yml -$ conda create -n dotfiles -c conda-forge pygit2 -$ conda run -n dotfiles python ~/.dotfiles/bin/sync_git_repos.py ~/.dotfiles/repos.ini ``` ## manual apps diff --git a/bin/sync_git_repos.py b/bin/sync_git_repos.py deleted file mode 100644 index f5dd736..0000000 --- a/bin/sync_git_repos.py +++ /dev/null @@ -1,76 +0,0 @@ -import configparser -import os -import sys - -import pygit2 - - -def init_repo(repo_name, repo_fp, remote, remote_name, callbacks, - github_peers): - repo = pygit2.discover_repository(repo_fp) - if repo is None: - print('cloning %s' % remote) - - init_remote = lambda r, n, u: r.remotes.create(remote_name, u) - repo = pygit2.clone_repository(remote, repo_fp, remote=init_remote, - callbacks=callbacks) - else: - print('already cloned %s' % remote) - - repo = pygit2.Repository(repo) - try: - repo.remotes[remote_name] - except: - repo.remotes.create(remote_name, remote) - - for peer in github_peers: - url = 'ssh://git@github.com/%s/%s' % (peer, repo_name) - - try: - repo.remotes[peer] - except KeyError: - repo.remotes.create(peer, url) - - if repo.remotes[peer].url != url: - repo.remotes.set_url(peer, url) - - -def sync_workspace(workspace_fp, repos, remote_host, remote_name, callbacks, - github_peers): - if not os.path.exists(workspace_fp): - os.makedirs(workspace_fp) - - for repo in repos: - repo_fp = os.path.join(workspace_fp, repo) - remote = 'ssh://%s/%s' % (remote_host, repo) - - init_repo(repo, repo_fp, remote, remote_name, callbacks, github_peers) - - -if __name__ == '__main__': - ini_fp = sys.argv[1] - cfg = configparser.ConfigParser() - cfg.read(ini_fp) - - 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'] - workspace_fp = os.path.expanduser(workspace_fp) - - 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 '' in github_peers: - github_peers.remove('') - - sync_workspace(workspace_fp, repos, remote_host, - remote_name, callbacks, github_peers) diff --git a/repos.ini b/repos.ini deleted file mode 100644 index 7a468f6..0000000 --- a/repos.ini +++ /dev/null @@ -1,172 +0,0 @@ -[personal] -workspace=~/projects/personal -remote_host=git@pingo.thermokar.st -remote_name=pingo -github_peers= -repos= - akdillon, - aoc2020, - cs685, - dot_ssh, - dotfiles, - elixir-class, - gitolite-admin, - gpx-web-utils, - notes, - pingo, - planner, - thermokar.st, - zettel, - -[personal-dokku] -workspace=~/projects/personal -remote_host=dokku@pingo.thermokar.st -remote_name=dokku -github_peers= -repos= - akdillon, - 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, - drf_ember_pagination, - hibernators, - hibernators-web, - hymenobacterdotinfo, - -[github_thermokast_personal] -workspace=~/projects/personal -remote_host=git@github.com/thermokarst -remote_name=thermokarst -github_peers= -repos= - thermokarst, - -[github_thermokarst_qiime2] -workspace=~/projects/qiime2 -remote_host=git@github.com/thermokarst -remote_name=thermokarst -github_peers= -repos= - q2-no-op, - workflows-playground, - -[github_thermokarst_forks_qiime2] -workspace=~/projects/qiime2 -remote_host=git@github.com/qiime2 -remote_name=qiime2 -github_peers=ebolyen,gregcaporaso,ChrisKeefe,Oddant1,nbokulich,andrewsanchez,cherman2,thermokarst-forks,Keegan-Evans,lizgehret -repos= - Keemei, - action-library-packaging, - busywork, - conda-channel-resource, - data302, - dev-docs, - docs, - environment-files, - library, - logos, - paper1, - paper2, - q2-alignment, - q2-composition, - q2-cutadapt, - q2-dada2, - q2-deblur, - q2-demux, - q2-diversity, - q2-diversity-lib, - q2-emperor, - q2-feature-classifier, - q2-feature-table, - q2-fragment-insertion, - q2-gneiss, - q2-longitudinal, - q2-metadata, - q2-mystery-stew, - q2-phylogeny, - q2-quality-control, - q2-quality-filter, - q2-sample-classifier, - q2-taxa, - q2-types, - q2-vsearch, - q2cli, - q2cwl, - q2galaxy, - q2lint, - q2studio, - q2templates, - q2view, - qiime2, - qiime2.github.io, - sphinx-ext-qiime2, - sphinx-qiime2-theme, - static-site-infrastructure, - template-repo, - view.qiime2.org, - vm-playbooks, - workshop-playbooks, - workshops, - -[github_thermokarst_forks_caporaso_lab] -workspace=~/projects/qiime2 -remote_host=git@github.com/caporaso-lab -remote_name=caporaso-lab -github_peers=ebolyen,gregcaporaso,thermokarst-forks -repos= - caporaso-lab.github.io, - code-of-conduct, - genome-sampler, - pretrained-feature-classifiers, - q2-phylogenomics, - -[github_thermokarst_forks_biocore] -workspace=~/projects/qiime2 -remote_host=git@github.com/biocore -remote_name=biocore -github_peers=ebolyen,thermokarst-forks -repos= - deblur, - emperor, - gneiss, - scikit-bio, - -[github_thermokarst_forks_bokulich_lab] -workspace=~/projects/qiime2 -remote_host=git@github.com/bokulich-lab -remote_name=bokulich-lab -github_peers=nbokulich,thermokarst-forks -repos= - RESCRIPt, - -[github_thermokarst_forks_conda_forge] -workspace=~/projects/qiime2 -remote_host=git@github.com/conda-forge -remote_name=conda-forge -github_peers=thermokarst-forks -repos= - biom-format-feedstock, - ijson-feedstock, - scikit-bio-feedstock, - -[github_gregcaporaso] -workspace=~/projects/qiime2 -remote_host=git@github.com/gregcaporaso -remote_name=gregcaporaso -github_peers= -repos= - caporaso-lab-secrets, diff --git a/repos.toml b/repos.toml new file mode 100644 index 0000000..c7f03ed --- /dev/null +++ b/repos.toml @@ -0,0 +1,226 @@ +# personal +[[workspace]] +path = "$HOME/Desktop/projects/personal" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@pingo.thermokar.st" +origin.name = "pingo" +repos = [ + "cs685", + "dot_ssh", + "dotfiles", + "elixir-class", + "gitolite-admin", + "gpx-web-utils", + "gwar", + "notes", + "pingo", +] +remotes = [] + +# personal-dokku +[[workspace]] +path = "$HOME/Desktop/projects/personal" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@pingo.thermokar.st" +origin.name = "pingo" +repos = [ + "akdillon", + "planner", + "thermokar.st", + "zettel", +] +remotes = [ + { name = "dokku", base_addr = "ssh://dokku@pingo.thermokar.st" }, +] + +# mds +[[workspace]] +path = "$HOME/Desktop/projects/mds" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@pingo.thermokar.st" +origin.name = "pingo" +repos = [ + "arctic_hibernators_schema", + "bactdb", + "bactdb_data", + "ccdb-api", + "ccdb-old", + "ccdb-web", + "drf_ember_pagination", + "hibernators", + "hibernators-web", + "hymenobacterdotinfo", +] +remotes = [] + +# github-thermokarst-personal +[[workspace]] +path = "$HOME/Desktop/projects/personal" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/thermokarst" +origin.name = "thermokarst" +repos = [ + "thermokarst", +] +remotes = [] + +# github-thermokarst-qiime2 +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/thermokarst" +origin.name = "thermokarst" +repos = [ + "q2-no-op", + "workflows-playground", +] +remotes = [] + +# github-thermokarst-forks-qiime2 +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/qiime2" +origin.name = "qiime2" +repos = [ + "Keemei", + "action-library-packaging", + "busywork", + "conda-channel-resource", + "data302", + "dev-docs", + "docs", + "environment-files", + "library", + "logos", + "paper1", + "paper2", + "q2-alignment", + "q2-composition", + "q2-cutadapt", + "q2-dada2", + "q2-deblur", + "q2-demux", + "q2-diversity", + "q2-diversity-lib", + "q2-emperor", + "q2-feature-classifier", + "q2-feature-table", + "q2-fragment-insertion", + "q2-gneiss", + "q2-longitudinal", + "q2-metadata", + "q2-mystery-stew", + "q2-phylogeny", + "q2-quality-control", + "q2-quality-filter", + "q2-sample-classifier", + "q2-taxa", + "q2-types", + "q2-vsearch", + "q2cli", + "q2cwl", + "q2galaxy", + "q2lint", + "q2studio", + "q2templates", + "q2view", + "qiime2", + "qiime2.github.io", + "sphinx-ext-qiime2", + "sphinx-qiime2-theme", + "static-site-infrastructure", + "template-repo", + "view.qiime2.org", + "vm-playbooks", + "workshop-playbooks", + "workshops", +] +remotes = [ + { name = "ChrisKeefe", base_addr = "ssh://git@github.com/ChrisKeefe" }, + { name = "Keegan-Evans", base_addr = "ssh://git@github.com/Keegan-Evans" }, + { name = "Oddant1", base_addr = "ssh://git@github.com/Oddant1" }, + { name = "cherman2", base_addr = "ssh://git@github.com/cherman2" }, + { name = "ebolyen", base_addr = "ssh://git@github.com/ebolyen" }, + { name = "gregcaporaso", base_addr = "ssh://git@github.com/gregcaporaso" }, + { name = "lizgehret", base_addr = "ssh://git@github.com/lizgehret" }, + { name = "nbokulich", base_addr = "ssh://git@github.com/nbokulich" }, + { name = "thermokarst-forks", base_addr = "ssh://git@github.com/thermokarst-forks" }, +] + +# github-thermokarst-forks-caporaso-lab +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/caporaso-lab" +origin.name = "caporaso-lab" +repos = [ + "caporaso-lab.github.io", + "code-of-conduct", + "genome-sampler", + "pretrained-feature-classifiers", + "q2-phylogenomics", +] +remotes = [ + { name = "ebolyen", base_addr = "ssh://git@github.com/ebolyen" }, + { name = "gregcaporaso", base_addr = "ssh://git@github.com/gregcaporaso" }, + { name = "thermokarst-forks", base_addr = "ssh://git@github.com/thermokarst-forks" }, +] + +# github-thermokarst-forks-biocore +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/biocore" +origin.name = "biocore" +repos = [ + "deblur", + "emperor", + "gneiss", + "scikit-bio", +] +remotes = [ + { name = "ebolyen", base_addr = "ssh://git@github.com/ebolyen" }, + { name = "thermokarst-forks", base_addr = "ssh://git@github.com/thermokarst-forks" }, +] + +# github-thermokarst-forks-bokulich-lab +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/bokulich-lab" +origin.name = "bokulich-lab" +repos = [ + "RESCRIPt", +] +remotes = [ + { name = "nbokulich", base_addr = "ssh://git@github.com/nbokulich" }, + { name = "thermokarst-forks", base_addr = "ssh://git@github.com/thermokarst-forks" }, +] + +# github-thermokarst-forks-conda-forge +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/conda-forge" +origin.name = "conda-forge" +repos = [ + "biom-format-feedstock", + "ijson-feedstock", + "scikit-bio-feedstock", +] +remotes = [ + { name = "thermokarst-forks", base_addr = "ssh://git@github.com/thermokarst-forks" }, +] + +# github-gregcaporaso +[[workspace]] +path = "$HOME/Desktop/projects/qiime2" +ssh_key_path = "$HOME/.ssh/id_ecdsa" +origin.base_addr = "ssh://git@github.com/gregcaporaso" +origin.name = "gregcaporaso" +repos = [ + "caporaso-lab-secrets", + "qiime2-meta-figures", +] +remotes = []