Initialer Commit

master
Clemens Klug 2018-04-24 10:04:37 +02:00
commit cf7350ea98
2 changed files with 37 additions and 0 deletions

12
sample.json Normal file
View File

@ -0,0 +1,12 @@
{
"/srv/services": [
"gitea",
"http",
"icinga",
"rz_measurements",
"traefik"
],
"/home/clemens/hg/biodiv2go/games/web": [
"."
]
}

25
start.py Normal file
View File

@ -0,0 +1,25 @@
import argparse
import json
import os
import subprocess
def start(config):
with open(config, "r") as src:
data = json.load(src)
if data:
for base in data:
for service in data[base]:
path = os.path.join(base, service)
print(path)
r = subprocess.run(["docker-compose", "up", "-d"], cwd=path)
print(r)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Docker-compose Autostart")
parser.add_argument("config_file")
args = parser.parse_args()
start(args.config_file)