Archived
5
0

Compare commits

..

17 Commits

4 changed files with 1727 additions and 1079 deletions
CHANGELOG.mdabra
bin
deploy/apps.coopcloud.tech

@ -9,6 +9,10 @@
# abra x.x.x (UNRELEASED)
- Sort `apps.json` when publishing ([39a7fc0](https://git.autonomic.zone/coop-cloud/abra/commit/39a7fc04fb5df1a6d78b84f51838530ab3eb76db))
- Fix publishing of rating for new apps ([0e28af9](https://git.autonomic.zone/coop-cloud/abra/commit/0e28af9eb1af6c6da705b4614ddd173c60576629))
- Detect compose filenames in `n+1` release generation ([ffc569e](https://git.autonomic.zone/coop-cloud/abra/commit/ffc569e275df7ca784a4db1a3331e17975fd8c87))
# abra 0.7.3 (2021-04-28)
- Only check for pw(q)gen if we're actually trying to use them ([#147](https://git.autonomic.zone/coop-cloud/abra/issues/147))

12
abra

@ -1649,7 +1649,7 @@ sub_app_secret_generate(){
if [[ -n "$LENGTH" ]]; then
if [ -z "$abra__cmd_" ]; then
require_binary pwgen
abra__cmd_="pwgen -s \"$LENGTH\" 1"
abra__cmd_="pwgen -s $LENGTH 1"
fi
else
if [ -z "$abra__cmd_" ]; then
@ -1881,6 +1881,7 @@ Create a new application recipe called <recipe>."
sub_recipe_create() {
recipe="$abra__recipe_"
recipe_kebab="${recipe//-/_}"
recipe_dir="$ABRA_DIR/apps/$recipe"
@ -1894,7 +1895,11 @@ sub_recipe_create() {
cd "$recipe_dir" || error "Failed to create directory '$recipe_dir'"
rm -rf .git .gitea
rm -rf .git .gitea .drone.yml
sed -i "s/\${REPO_NAME}/$recipe/g" README.md
sed -i "s/\${REPO_NAME_TITLE}/$recipe/g" README.md
sed -i "s/\${REPO_NAME_KEBAB}/$recipe_kebab/g" .env.sample
success "New recipe created in '$recipe_dir', happy hacking! 👌"
}
@ -2019,8 +2024,7 @@ sub_recipe_release() {
for compose_file in "${compose_files[@]}"; do
mapfile -t services < <($YQ e -N '.services | keys | .[]' "$compose_file" | sort -u)
if ! printf '%s\0' "${services[@]}" | grep -Fqxz -- "app"; then
if [ "$compose_file" = "compose.yml" ] && ! printf '%s\0' "${services[@]}" | grep -Fqxz -- "app"; then
# shellcheck disable=SC2016
warning 'No `app` service found; which one should we use for the version number?'
select service_item in "${services[@]##*/}"; do

@ -25,15 +25,21 @@ SCRIPT_PATH = Path(__file__).absolute().parent
REPOS_TO_SKIP = (
"abra",
"abra-apps",
"abra-gandi",
"abra-hetzner",
"backup-bot",
"cloud.autonomic.zone",
"docs.cloud.autonomic.zone",
"coopcloud.tech",
"coturn",
"docker-cp-deploy",
"docker-dind-bats-kcov",
"docs.coopcloud.tech",
"example",
"gardening",
"organising",
"pyabra",
"stack-ssh-deploy",
"radicle-seed-node",
"coturn",
"stack-ssh-deploy",
"swarm-cronjob",
)
log = getLogger(__name__)
@ -101,7 +107,6 @@ def clone_all_apps(repos_json):
repos = [[p["name"], p["ssh_url"]] for p in repos_json]
for name, url in repos:
continue
if name in REPOS_TO_SKIP:
continue
@ -145,11 +150,6 @@ def generate_apps_json(repos_json):
"default_branch": repo_details.get("default_branch", ""),
"description": repo_details.get("description", ""),
"website": repo_details.get("website", ""),
# Note(decentral1se): please note that the app metadata do not
# correspond to version tags. We simply parse the latest metadata
# list from HEAD. This may lead to unexpected situations where
# users believe X feature is available under Y version but it is
# not.
"features": metadata,
"versions": get_app_versions(app_path, cached_apps_json),
"icon": repo_details.get("avatar_url", ""),
@ -164,9 +164,13 @@ def get_app_metadata(app_path):
chdir(app_path)
try:
with open(f"{app_path}/README.md", "r") as handle:
log.info(f"{app_path}/README.md")
contents = handle.read()
except Exception:
log.info(f"No {app_path}/README.md discovered, moving on")
return {}
try:
for match in findall(r"\*\*.*\s\*", contents):
@ -179,6 +183,10 @@ def get_app_metadata(app_path):
"rating": match.split(",")[1].strip(),
"source": match.split(",")[-1].replace("*", "").strip(),
}
elif title == "status":
value = {"❶💚": 1, "❷💛": 2, "❸🍎": 3, "❹💣": 4, "?": 5, "": 5}[
match.split(":")[-1].replace("*", "").strip()
]
else:
value = match.split(":")[-1].replace("*", "").strip()
@ -276,7 +284,13 @@ def main():
target = f"{SCRIPT_PATH}/../deploy/apps.coopcloud.tech/apps.json"
with open(target, "w", encoding="utf-8") as handle:
dump(generate_apps_json(repos_json), handle, ensure_ascii=False, indent=4)
dump(
generate_apps_json(repos_json),
handle,
ensure_ascii=False,
indent=4,
sort_keys=True,
)
log.info(f"Successfully generated {target}")

File diff suppressed because it is too large Load Diff