Compare commits

...

22 Commits
0.7.3 ... 0.7.4

Author SHA1 Message Date
f374b1bfa1 New patch release 2021-05-10 10:39:57 +02:00
0e6b0e0879 Add change log entry 2021-05-10 10:38:02 +02:00
3a353f4062 Possible fix to invalid length "20"?
See https://git.autonomic.zone/coop-cloud/abra/pulls/160.
2021-05-10 10:36:23 +02:00
e0258d397b Merge pull request 'feat: switches to conventional confirmation prompt' (#162) from roxxers/abra:prompt into main
Reviewed-on: https://git.autonomic.zone/coop-cloud/abra/pulls/162
2021-05-10 10:26:09 +02:00
e8ac353453 feat: switches to conventional confirmation prompt 2021-05-08 21:45:52 +01:00
3wc
552abdd980 Don't clobber global $DOMAIN variable
Closes #156
2021-05-06 00:43:16 +02:00
3wc
935007dd86 Improve recipe new subcommand 2021-05-03 03:22:32 +02:00
2cd1d053f0 Update change log 2021-05-02 22:18:04 +02:00
a1c8620cc0 Sort the JSON 2021-05-02 22:14:22 +02:00
39a7fc04fb Sort that JSON 2021-05-02 22:14:15 +02:00
a8b5fb5c1e Cut a new release of the apps.json 2021-05-02 22:11:12 +02:00
18e22b24ea Don't explode if missing the README 2021-05-02 22:10:58 +02:00
b53a3ed3f7 Exclude that repo too 2021-05-02 21:58:02 +02:00
112787b3aa Add gardening to exluded repos list 2021-05-02 21:48:35 +02:00
4f46ff7ee6 Remove that 2021-05-02 21:44:11 +02:00
845de093ba Let the formatter run at that 2021-05-02 21:42:55 +02:00
65e83ed885 Exclude more repos 2021-05-02 21:42:34 +02:00
b98d69b33e Remove slightly off-topic comment 2021-05-02 20:30:09 +02:00
d159b98c3c Add other plugin repos 2021-05-02 20:30:08 +02:00
1ef5c3980d Use new name of repos and sort 2021-05-02 20:30:08 +02:00
3wc
ffc569e275 Further fix to #151 2021-04-30 22:55:59 +02:00
3wc
0e28af9eb1 app-json.py: parse emoji status scores into digits 2021-04-30 22:55:59 +02:00
5 changed files with 1738 additions and 1087 deletions

View File

@ -9,6 +9,13 @@
# abra x.x.x (UNRELEASED) # abra x.x.x (UNRELEASED)
# abra 0.7.4 (2021-05-10)
- 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))
- Fix secret generation when specifying length ([3a353f4](https://git.autonomic.zone/coop-cloud/abra/commit/3a353f4062baccde2c9f175b03afb2db6d462ae4))
# abra 0.7.3 (2021-04-28) # 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)) - Only check for pw(q)gen if we're actually trying to use them ([#147](https://git.autonomic.zone/coop-cloud/abra/issues/147))

26
abra
View File

@ -3,7 +3,7 @@
GIT_URL="https://git.autonomic.zone/coop-cloud/" GIT_URL="https://git.autonomic.zone/coop-cloud/"
ABRA_APPS_URL="https://apps.coopcloud.tech" ABRA_APPS_URL="https://apps.coopcloud.tech"
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}" ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
ABRA_VERSION="0.7.3" ABRA_VERSION="0.7.4"
ABRA_BACKUP_DIR="${ABRA_BACKUP_DIR:-$ABRA_DIR/backups}" ABRA_BACKUP_DIR="${ABRA_BACKUP_DIR:-$ABRA_DIR/backups}"
ABRA_VENDOR_DIR="$ABRA_DIR/vendor" ABRA_VENDOR_DIR="$ABRA_DIR/vendor"
ABRA_APPS_JSON="${ABRA_DIR}/apps.json" ABRA_APPS_JSON="${ABRA_DIR}/apps.json"
@ -808,17 +808,17 @@ ensure_stack_deployed() {
} }
ensure_domain_deployed() { ensure_domain_deployed() {
DOMAIN=$1 local domain=$1
warning "Waiting for $DOMAIN to come up..." warning "Waiting for $domain to come up..."
idx=1 idx=1
until curl --output /dev/null --silent --head --fail "$DOMAIN"; do until curl --output /dev/null --silent --head --fail "$domain"; do
debug "Polled $DOMAIN $idx time(s) already" debug "Polled $domain $idx time(s) already"
sleep 3 sleep 3
idx=$(("$idx" + 1)) idx=$(("$idx" + 1))
if [[ $idx -gt 10 ]]; then if [[ $idx -gt 10 ]]; then
error "$DOMAIN still isn't up, check status by running \"abra app ${STACK_NAME} ps\"" error "$domain still isn't up, check status by running \"abra app ${STACK_NAME} ps\""
fi fi
done done
} }
@ -899,7 +899,7 @@ prompt_confirm() {
return return
fi fi
read -rp "Continue? (y/[n])? " choice read -rp "Continue? [y/N]? " choice
case "$choice" in case "$choice" in
y|Y ) return ;; y|Y ) return ;;
@ -1649,7 +1649,7 @@ sub_app_secret_generate(){
if [[ -n "$LENGTH" ]]; then if [[ -n "$LENGTH" ]]; then
if [ -z "$abra__cmd_" ]; then if [ -z "$abra__cmd_" ]; then
require_binary pwgen require_binary pwgen
abra__cmd_="pwgen -s \"$LENGTH\" 1" abra__cmd_="pwgen -s $LENGTH 1"
fi fi
else else
if [ -z "$abra__cmd_" ]; then if [ -z "$abra__cmd_" ]; then
@ -1881,6 +1881,7 @@ Create a new application recipe called <recipe>."
sub_recipe_create() { sub_recipe_create() {
recipe="$abra__recipe_" recipe="$abra__recipe_"
recipe_kebab="${recipe//-/_}"
recipe_dir="$ABRA_DIR/apps/$recipe" recipe_dir="$ABRA_DIR/apps/$recipe"
@ -1894,7 +1895,11 @@ sub_recipe_create() {
cd "$recipe_dir" || error "Failed to create directory '$recipe_dir'" 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! 👌" success "New recipe created in '$recipe_dir', happy hacking! 👌"
} }
@ -2019,8 +2024,7 @@ sub_recipe_release() {
for compose_file in "${compose_files[@]}"; do for compose_file in "${compose_files[@]}"; do
mapfile -t services < <($YQ e -N '.services | keys | .[]' "$compose_file" | sort -u) mapfile -t services < <($YQ e -N '.services | keys | .[]' "$compose_file" | sort -u)
if [ "$compose_file" = "compose.yml" ] && ! printf '%s\0' "${services[@]}" | grep -Fqxz -- "app"; then
if ! printf '%s\0' "${services[@]}" | grep -Fqxz -- "app"; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
warning 'No `app` service found; which one should we use for the version number?' warning 'No `app` service found; which one should we use for the version number?'
select service_item in "${services[@]##*/}"; do select service_item in "${services[@]##*/}"; do

View File

@ -25,15 +25,21 @@ SCRIPT_PATH = Path(__file__).absolute().parent
REPOS_TO_SKIP = ( REPOS_TO_SKIP = (
"abra", "abra",
"abra-apps", "abra-apps",
"abra-gandi",
"abra-hetzner",
"backup-bot", "backup-bot",
"cloud.autonomic.zone", "coopcloud.tech",
"docs.cloud.autonomic.zone", "coturn",
"docker-cp-deploy",
"docker-dind-bats-kcov",
"docs.coopcloud.tech",
"example", "example",
"gardening",
"organising", "organising",
"pyabra", "pyabra",
"stack-ssh-deploy",
"radicle-seed-node", "radicle-seed-node",
"coturn", "stack-ssh-deploy",
"swarm-cronjob",
) )
log = getLogger(__name__) log = getLogger(__name__)
@ -101,7 +107,6 @@ def clone_all_apps(repos_json):
repos = [[p["name"], p["ssh_url"]] for p in repos_json] repos = [[p["name"], p["ssh_url"]] for p in repos_json]
for name, url in repos: for name, url in repos:
continue
if name in REPOS_TO_SKIP: if name in REPOS_TO_SKIP:
continue continue
@ -145,11 +150,6 @@ def generate_apps_json(repos_json):
"default_branch": repo_details.get("default_branch", ""), "default_branch": repo_details.get("default_branch", ""),
"description": repo_details.get("description", ""), "description": repo_details.get("description", ""),
"website": repo_details.get("website", ""), "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, "features": metadata,
"versions": get_app_versions(app_path, cached_apps_json), "versions": get_app_versions(app_path, cached_apps_json),
"icon": repo_details.get("avatar_url", ""), "icon": repo_details.get("avatar_url", ""),
@ -164,9 +164,13 @@ def get_app_metadata(app_path):
chdir(app_path) chdir(app_path)
with open(f"{app_path}/README.md", "r") as handle: try:
log.info(f"{app_path}/README.md") with open(f"{app_path}/README.md", "r") as handle:
contents = handle.read() 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: try:
for match in findall(r"\*\*.*\s\*", contents): for match in findall(r"\*\*.*\s\*", contents):
@ -179,6 +183,10 @@ def get_app_metadata(app_path):
"rating": match.split(",")[1].strip(), "rating": match.split(",")[1].strip(),
"source": match.split(",")[-1].replace("*", "").strip(), "source": match.split(",")[-1].replace("*", "").strip(),
} }
elif title == "status":
value = {"❶💚": 1, "❷💛": 2, "❸🍎": 3, "❹💣": 4, "?": 5, "": 5}[
match.split(":")[-1].replace("*", "").strip()
]
else: else:
value = match.split(":")[-1].replace("*", "").strip() value = match.split(":")[-1].replace("*", "").strip()
@ -276,7 +284,13 @@ def main():
target = f"{SCRIPT_PATH}/../deploy/apps.coopcloud.tech/apps.json" target = f"{SCRIPT_PATH}/../deploy/apps.coopcloud.tech/apps.json"
with open(target, "w", encoding="utf-8") as handle: 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}") log.info(f"Successfully generated {target}")

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ABRA_VERSION="0.7.3" ABRA_VERSION="0.7.4"
GIT_URL="https://git.autonomic.zone/coop-cloud/abra" GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra" ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
ABRA_DIR="${ABRA_DIR:-$HOME/.abra/}" ABRA_DIR="${ABRA_DIR:-$HOME/.abra/}"