Bootstrap gardening repo

This commit is contained in:
Luke Murphy 2020-10-27 08:38:27 +01:00
commit ec2b6b8214
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
5 changed files with 41 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
clones/

7
Makefile Normal file
View File

@ -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;

13
README.md Normal file
View File

@ -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

19
clone_all.py Normal file
View File

@ -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

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
requests