commit ec2b6b821441b07a9efe6c249897cdc07631c95e Author: Luke Murphy Date: Tue Oct 27 08:38:27 2020 +0100 Bootstrap gardening repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f66fead --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +clones/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5e92fff --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +default: install +.PHONY: install + +install: + @python3 -m venv .venv && \ + .venv/bin/pip install -U pip setuptools wheel && \ + .venv/bin/pip install -r requirements.txt; diff --git a/README.md b/README.md new file mode 100644 index 0000000..498aa95 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# gardening + +Gardening the Cooperative Cloud configurations. + +## Hacking + +### Setup + +`make` + +### Scripts + +- **clone_all.py**: clone all coop-cloud/... repositories into a local clones folder diff --git a/clone_all.py b/clone_all.py new file mode 100644 index 0000000..e729e03 --- /dev/null +++ b/clone_all.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +from os import mkdir +from os.path import exists +from pathlib import Path +from shlex import split +from subprocess import run + +from requests import get + +response = get("https://git.autonomic.zone/api/v1/orgs/coop-cloud/repos") +repos = [[p["name"], p["clone_url"]] for p in response.json()] +clones = Path("clones").absolute() +if not exists(clones): + mkdir(clones) +for name, url in repos: + try: + run(split(f"git clone {url} {clones}/{name}")) + except Exception: + pass diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests