Compare commits

...

9 Commits

7 changed files with 32 additions and 19 deletions

View File

@ -48,9 +48,9 @@ steps:
- name: trigger downstream builds - name: trigger downstream builds
image: plugins/downstream image: plugins/downstream
settings: settings:
server: https://drone.autonomic.zone server: https://build.coopcloud.tech
token: token:
from_secret: decentral1se_token from_secret: coopcloud_drone_token
fork: true fork: true
repositories: repositories:
- coop-cloud/drone-abra - coop-cloud/drone-abra
@ -72,7 +72,7 @@ steps:
roomid: "IFazIpLtxiScqbHqoa:autonomic.zone" roomid: "IFazIpLtxiScqbHqoa:autonomic.zone"
userid: "@autono-bot:autonomic.zone" userid: "@autono-bot:autonomic.zone"
accesstoken: accesstoken:
from_secret: autono_bot_access_token from_secret: autonobot_rocketchat_access_token
depends_on: depends_on:
- run shellcheck - run shellcheck
- run flake8 - run flake8

View File

@ -9,6 +9,22 @@
# abra x.x.x (UNRELEASED) # abra x.x.x (UNRELEASED)
# abra 10.0.5 (2021-09-06)
- Fix catalogue version listing parsing.
# abra 10.0.4 (2021-09-06)
- Understand how to parse the new catalogue versions listing.
# abra 10.0.3 (????-??-??)
- Sorry folks, no change log.
# abra 10.0.2 (????-??-??)
- Sorry folks, no change log.
# abra 10.0.1 (2021-07-30) # abra 10.0.1 (2021-07-30)
- New `recipe .. lint` command ([#202](https://git.autonomic.zone/coop-cloud/abra/issues/202)) - New `recipe .. lint` command ([#202](https://git.autonomic.zone/coop-cloud/abra/issues/202))

View File

@ -15,7 +15,7 @@ RUN mkdir -p ~/.abra/apps
RUN mkdir -p ~/.abra/vendor RUN mkdir -p ~/.abra/vendor
RUN mkdir -p ~/.ssh/ RUN mkdir -p ~/.ssh/
RUN ssh-keyscan -p 2222 git.autonomic.zone > ~/.ssh/known_hosts RUN ssh-keyscan -p 2222 git.coopcloud.tech > ~/.ssh/known_hosts
RUN curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 --output ~/.abra/vendor/jq RUN curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 --output ~/.abra/vendor/jq
RUN chmod +x ~/.abra/vendor/jq RUN chmod +x ~/.abra/vendor/jq

13
abra
View File

@ -2,10 +2,10 @@
# shellcheck disable=SC2154 # shellcheck disable=SC2154
GIT_URL="https://git.autonomic.zone/coop-cloud/" GIT_URL="https://git.coopcloud.tech/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="10.0.1" ABRA_VERSION="10.0.5"
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"
@ -679,11 +679,6 @@ pwqgen_native() {
shuf -n 3 /usr/share/dict/words | tr -dc 'a-zA-Z0-9' | tr -d '\n' shuf -n 3 /usr/share/dict/words | tr -dc 'a-zA-Z0-9' | tr -d '\n'
} }
# FIXME 3wc: update or remove
if [ -z "$ABRA_ENV" ] && [ -f .env ] && type direnv > /dev/null 2>&1 && ! direnv status | grep -q 'Found RC allowed true'; then
error "direnv is blocked, run direnv allow"
fi
###### Parse apps.json ###### Parse apps.json
get_recipes() { get_recipes() {
@ -702,7 +697,7 @@ get_recipe_versions() {
if [ "$recipe_json" = "null" ]; then if [ "$recipe_json" = "null" ]; then
declare -a RECIPE_VERSIONS declare -a RECIPE_VERSIONS
else else
mapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | keys | .[]" - | sort) mapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | .[] | keys | add")
fi fi
} }
@ -1719,7 +1714,7 @@ sub_app_secret_generate(){
warning "These generated secrets are now stored as encrypted data on your server" warning "These generated secrets are now stored as encrypted data on your server"
warning "Please take a moment to make sure you have saved a copy of the passwords" warning "Please take a moment to make sure you have saved a copy of the passwords"
warning "Abra is not able to show the password values in plain text again" warning "Abra is not able to show the password values in plain text again"
warning "See https://docs.cloud.autonomic.zone/secrets/ for more on secrets" warning "See https://docs.coopcloud.tech/secrets/ for more on secrets"
msg_already_outputted="true" msg_already_outputted="true"
fi fi

View File

@ -14,6 +14,7 @@ HOME_PATH = expanduser("~/")
CLONES_PATH = Path(f"{HOME_PATH}/.abra/apps").absolute() CLONES_PATH = Path(f"{HOME_PATH}/.abra/apps").absolute()
REPOS_TO_SKIP = ( REPOS_TO_SKIP = (
"abra", "abra",
"abra-aur",
"abra-apps", "abra-apps",
"abra-capsul", "abra-capsul",
"abra-gandi", "abra-gandi",
@ -21,6 +22,7 @@ REPOS_TO_SKIP = (
"apps", "apps",
"auto-apps-json", "auto-apps-json",
"auto-mirror", "auto-mirror",
"aur-abra-git",
"backup-bot", "backup-bot",
"coopcloud.tech", "coopcloud.tech",
"coturn", "coturn",
@ -33,6 +35,7 @@ REPOS_TO_SKIP = (
"organising", "organising",
"pyabra", "pyabra",
"radicle-seed-node", "radicle-seed-node",
"tagcmp",
"stack-ssh-deploy", "stack-ssh-deploy",
"swarm-cronjob", "swarm-cronjob",
"tyop", "tyop",
@ -63,7 +66,7 @@ def _run_cmd(cmd, shell=False, **kwargs):
def get_repos_json(): def get_repos_json():
""" Retrieve repo list from Gitea """ """ Retrieve repo list from Gitea """
url = "https://git.autonomic.zone/api/v1/orgs/coop-cloud/repos" url = "https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos"
log.info(f"Retrieving {url}") log.info(f"Retrieving {url}")

View File

@ -140,7 +140,7 @@ def get_app_metadata(app_path):
def get_app_versions(app_path, cached_apps_json): def get_app_versions(app_path, cached_apps_json):
versions = {} versions = []
chdir(app_path) chdir(app_path)
@ -206,7 +206,7 @@ def get_app_versions(app_path, cached_apps_json):
parsed_services.append(service) parsed_services.append(service)
versions[tag] = service_versions versions.append({tag: service_versions})
_run_cmd(f"git checkout {initial_branch}") _run_cmd(f"git checkout {initial_branch}")

View File

@ -2,7 +2,7 @@
# shellcheck disable=SC2154,SC2034 # shellcheck disable=SC2154,SC2034
ABRA_VERSION="10.0.3" ABRA_VERSION="10.0.5"
GIT_URL="https://git.coopcloud.tech/coop-cloud/abra" GIT_URL="https://git.coopcloud.tech/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}"
@ -170,13 +170,12 @@ function install_requirements {
else else
echo "Sorry, we only support Debian based distributions at the moment" echo "Sorry, we only support Debian based distributions at the moment"
echo "You'll have to install the requirements manually for your distribution" echo "You'll have to install the requirements manually for your distribution"
echo "See https://git.autonomic.zone/coop-cloud/abra#requirements for more" echo "See https://git.coopcloud.tech/coop-cloud/abra#requirements for more"
fi fi
} }
function install_abra_release { function install_abra_release {
mkdir -p "$HOME/.local/bin" mkdir -p "$HOME/.local/bin"
set -x
curl "$ABRA_SRC" > "$HOME/.local/bin/abra" curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
chmod +x "$HOME/.local/bin/abra" chmod +x "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra" echo "abra installed to $HOME/.local/bin/abra"