First working generation (woohoo)
This commit is contained in:
parent
cd647f090b
commit
f4ab771e2a
@ -52,7 +52,7 @@ def gen_apps_json():
|
|||||||
chdir(app_path)
|
chdir(app_path)
|
||||||
|
|
||||||
output = check_output("git tag --list", shell=True)
|
output = check_output("git tag --list", shell=True)
|
||||||
tags = output.strip().decode("utf-8")
|
tags = output.decode("utf-8").strip().split()
|
||||||
|
|
||||||
if not tags:
|
if not tags:
|
||||||
continue
|
continue
|
||||||
@ -61,16 +61,21 @@ def gen_apps_json():
|
|||||||
apps_json[app] = {
|
apps_json[app] = {
|
||||||
"category": "apps",
|
"category": "apps",
|
||||||
"repository": f"https://git.autonomic.zone/coop-cloud/{app}.git",
|
"repository": f"https://git.autonomic.zone/coop-cloud/{app}.git",
|
||||||
"features": get_app_features(app_path),
|
"features": get_app_features(app_path, tag),
|
||||||
"versions": get_app_versions(app_path),
|
"versions": get_app_versions(app_path, tag),
|
||||||
}
|
}
|
||||||
|
|
||||||
return apps_json
|
return apps_json
|
||||||
|
|
||||||
|
|
||||||
def get_app_features(app_path):
|
def get_app_features(app_path, tag):
|
||||||
|
print(f"Gathering features for {app_path}, tag: {tag}")
|
||||||
|
|
||||||
features = {}
|
features = {}
|
||||||
|
|
||||||
|
chdir(app_path)
|
||||||
|
run(f"git checkout {tag}", shell=True)
|
||||||
|
|
||||||
with open(f"{app_path}/README.md", "r") as handle:
|
with open(f"{app_path}/README.md", "r") as handle:
|
||||||
contents = handle.read()
|
contents = handle.read()
|
||||||
|
|
||||||
@ -87,17 +92,16 @@ def get_app_features(app_path):
|
|||||||
value = match.split(":")[-1].replace("*", "").strip()
|
value = match.split(":")[-1].replace("*", "").strip()
|
||||||
features[title] = value
|
features[title] = value
|
||||||
|
|
||||||
|
run(f"git checkout HEAD", shell=True)
|
||||||
return features
|
return features
|
||||||
|
|
||||||
|
|
||||||
def get_app_versions(app_path):
|
def get_app_versions(app_path, tag):
|
||||||
|
print(f"Gathering versions for {app_path}, tag: {tag}")
|
||||||
|
|
||||||
versions = []
|
versions = []
|
||||||
|
|
||||||
chdir(app_path)
|
chdir(app_path)
|
||||||
|
|
||||||
tags = check_output(f"git tag --list", shell=True).decode("utf-8").strip().split()
|
|
||||||
|
|
||||||
for tag in tags:
|
|
||||||
run(f"git checkout {tag}", shell=True)
|
run(f"git checkout {tag}", shell=True)
|
||||||
|
|
||||||
services_command = "yq e '.services | keys | .[]' compose*.yml"
|
services_command = "yq e '.services | keys | .[]' compose*.yml"
|
||||||
@ -114,10 +118,9 @@ def get_app_versions(app_path):
|
|||||||
digest_command = f"skopeo inspect docker://{image} | jq '.Digest'"
|
digest_command = f"skopeo inspect docker://{image} | jq '.Digest'"
|
||||||
output = check_output(digest_command, shell=True).decode("utf-8")
|
output = check_output(digest_command, shell=True).decode("utf-8")
|
||||||
digest = output.strip().split(":")[-1][:8]
|
digest = output.strip().split(":")[-1][:8]
|
||||||
versions.append(
|
versions.append({service: {"image": image, "tag": tag, "digest": digest}})
|
||||||
{service: {"image": image, "tag": tag, "digest": digest}}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
run(f"git checkout HEAD", shell=True)
|
||||||
return versions
|
return versions
|
||||||
|
|
||||||
|
|
||||||
|
36
deploy/abra-apps.autonomic.zone/abra-apps.json
Normal file
36
deploy/abra-apps.autonomic.zone/abra-apps.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"gitea": {
|
||||||
|
"category": "apps",
|
||||||
|
"repository": "https://git.autonomic.zone/coop-cloud/gitea.git",
|
||||||
|
"features": {
|
||||||
|
"category": "Development",
|
||||||
|
"status": "❷💛",
|
||||||
|
"image": {
|
||||||
|
"image": "gitea/gitea",
|
||||||
|
"url": "https://hub.docker.com/gitea/gitea",
|
||||||
|
"rating": "❶💚",
|
||||||
|
"source": "upstream"
|
||||||
|
},
|
||||||
|
"healthcheck": "Yes",
|
||||||
|
"backups": "No",
|
||||||
|
"email": "?",
|
||||||
|
"tests": "❷💛"
|
||||||
|
},
|
||||||
|
"versions": [
|
||||||
|
{
|
||||||
|
"app": {
|
||||||
|
"image": "gitea/gitea:1.13.6",
|
||||||
|
"tag": "1.13.6",
|
||||||
|
"digest": "1d90f984"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"db": {
|
||||||
|
"image": "mariadb:10.5",
|
||||||
|
"tag": "1.13.6",
|
||||||
|
"digest": "ab7c906b"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user