Bootstrap gardening repo
This commit is contained in:
commit
ec2b6b8214
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
clones/
|
7
Makefile
Normal file
7
Makefile
Normal 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
13
README.md
Normal 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
19
clone_all.py
Normal 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
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
requests
|
Reference in New Issue
Block a user