Compare commits

..

1 Commits

Author SHA1 Message Date
3wc
5b2e37a7b2 WIP: mass version checking 2021-07-10 00:47:55 +02:00
8 changed files with 187 additions and 334 deletions

View File

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

View File

@ -9,29 +9,6 @@
# 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)
- New `recipe .. lint` command ([#202](https://git.autonomic.zone/coop-cloud/abra/issues/202))
- `abra-capsul` plugin ([e85bcc4](https://git.autonomic.zone/coop-cloud/abra/commit/e85bcc4))
- Fix `run <service> <cmd>` invocations ([#204](https://git.autonomic.zone/coop-cloud/abra/issues/204))
- Point installer at our [half-migrated new Gitea instance](https://git.coopcloud.tech) ([#207](https://git.coopcloud.tech/coop-cloud/abra/pulls/207) thanks @nicksellen!)
# abra 10.0.0 (2021-07-06)
- Add `--bump` to `deploy` command to allow packagers to make minor package related releases ([#173](https://git.autonomic.zone/coop-cloud/abra/issues/173))

View File

@ -15,7 +15,7 @@ RUN mkdir -p ~/.abra/apps
RUN mkdir -p ~/.abra/vendor
RUN mkdir -p ~/.ssh/
RUN ssh-keyscan -p 2222 git.coopcloud.tech > ~/.ssh/known_hosts
RUN ssh-keyscan -p 2222 git.autonomic.zone > ~/.ssh/known_hosts
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

View File

@ -1,13 +1,5 @@
# abra
## 🔥 🔥 🔥 D E P R E C A T E D 🔥 🔥 🔥
[`abra`](https://git.coopcloud.tech/coop-cloud/abra) served us well but we're porting it to [Golang](https://golang.org) over in [`go-abra`](https://git.coopcloud.tech/coop-cloud/go-abra). To learn more about the reasons for that, see [this blog post](https://coopcloud.tech/blog/this-month-in-coop-cloud-july/). This means this repository and tool are officially deprecated as of August 1rst 2021. We will still provide bug security fixes but no new features will be developed in `abra`. Feel free to go on using it and reporting issues against this issue tracker. Thanks for all the good times Bash.
## 🔥 🔥 🔥 D E P R E C A T E D 🔥 🔥 🔥
---
[![Build Status](https://drone.autonomic.zone/api/badges/coop-cloud/abra/status.svg)](https://drone.autonomic.zone/coop-cloud/abra)
> https://coopcloud.tech

462
abra
View File

@ -2,10 +2,10 @@
# shellcheck disable=SC2154
GIT_URL="https://git.coopcloud.tech/coop-cloud/"
GIT_URL="https://git.autonomic.zone/coop-cloud/"
ABRA_APPS_URL="https://apps.coopcloud.tech"
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
ABRA_VERSION="10.0.5"
ABRA_VERSION="10.0.0"
ABRA_BACKUP_DIR="${ABRA_BACKUP_DIR:-$ABRA_DIR/backups}"
ABRA_VENDOR_DIR="$ABRA_DIR/vendor"
ABRA_APPS_JSON="${ABRA_DIR}/apps.json"
@ -51,7 +51,6 @@ Usage:
abra [options] recipe ls
abra [options] recipe create <recipe>
abra [options] recipe <recipe> release [--force] [--bump]
abra [options] recipe <recipe> lint
abra [options] recipe <recipe> versions
abra [options] server add <host> [<user>] [<port>]
abra [options] server new <provider> -- <args>
@ -178,103 +177,103 @@ eval "var_$1+=($value)"; else eval "var_$1=$value"; fi; return 0; fi; done
return 1; }; stdout() { printf -- "cat <<'EOM'\n%s\nEOM\n" "$1"; }; stderr() {
printf -- "cat <<'EOM' >&2\n%s\nEOM\n" "$1"; }; error() {
[[ -n $1 ]] && stderr "$1"; stderr "$usage"; _return 1; }; _return() {
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2862}
usage=${DOC:368:1925}; digest=d31d6
shorts=(-e -C -d -s -U -n -b -v -h '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
longs=(--env --skip-check --debug --stack --skip-update --no-prompt --branch --verbose --help --status --server --type --domain --app-name --pass --secrets --all --update --force --fast --chaos --volumes --no-tty --user --bump --dev)
argcounts=(1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0); node_0(){
value __env 0; }; node_1(){ switch __skip_check 1; }; node_2(){ switch __debug 2
}; node_3(){ value __stack 3; }; node_4(){ switch __skip_update 4; }; node_5(){
switch __no_prompt 5; }; node_6(){ value __branch 6; }; node_7(){
switch __verbose 7; }; node_8(){ switch __help 8; }; node_9(){ switch __status 9
}; node_10(){ value __server 10; }; node_11(){ value __type 11; }; node_12(){
value __domain 12; }; node_13(){ value __app_name 13; }; node_14(){
switch __pass 14; }; node_15(){ switch __secrets 15; }; node_16(){
switch __all 16; }; node_17(){ switch __update 17; }; node_18(){
switch __force 18; }; node_19(){ switch __fast 19; }; node_20(){
switch __chaos 20; }; node_21(){ switch __volumes 21; }; node_22(){
switch __no_tty 22; }; node_23(){ value __user 23; }; node_24(){
switch __bump 24; }; node_25(){ switch __dev 25; }; node_26(){ value _type_ a; }
node_27(){ value _app_ a; }; node_28(){ value _service_ a; }; node_29(){
value _version_ a; }; node_30(){ value _src_ a; }; node_31(){ value _dst_ a; }
node_32(){ value _backup_file_ a; }; node_33(){ value _args_ a true; }
node_34(){ value _secret_ a; }; node_35(){ value _cmd_ a; }; node_36(){
value _data_ a; }; node_37(){ value _volume_ a; }; node_38(){ value _command_ a
}; node_39(){ value _recipe_ a; }; node_40(){ value _host_ a; }; node_41(){
value _user_ a; }; node_42(){ value _port_ a; }; node_43(){ value _provider_ a
}; node_44(){ value _subcommands_ a true; }; node_45(){ _command app; }
node_46(){ _command list; }; node_47(){ _command ls; }; node_48(){ _command new
}; node_49(){ _command backup; }; node_50(){ _command deploy; }; node_51(){
_command check; }; node_52(){ _command version; }; node_53(){ _command config; }
node_54(){ _command cp; }; node_55(){ _command logs; }; node_56(){ _command ps
}; node_57(){ _command restore; }; node_58(){ _command rm; }; node_59(){
_command delete; }; node_60(){ _command run; }; node_61(){ _command rollback; }
node_62(){ _command restart; }; node_63(){ _command secret; }; node_64(){
_command generate; }; node_65(){ _command insert; }; node_66(){
_command undeploy; }; node_67(){ _command volume; }; node_68(){ _command recipe
}; node_69(){ _command create; }; node_70(){ _command release; }; node_71(){
_command lint; }; node_72(){ _command versions; }; node_73(){ _command server; }
node_74(){ _command add; }; node_75(){ _command __ --; }; node_76(){
_command init; }; node_77(){ _command apps; }; node_78(){ _command upgrade; }
node_79(){ _command doctor; }; node_80(){ _command help; }; node_81(){
optional 0 1 2 3 4 5 6 7 8; }; node_82(){ optional 81; }; node_83(){
either 46 47; }; node_84(){ required 83; }; node_85(){ optional 9; }; node_86(){
optional 10; }; node_87(){ optional 11; }; node_88(){ required 82 45 84 85 86 87
}; node_89(){ optional 12; }; node_90(){ optional 13; }; node_91(){ optional 14
}; node_92(){ optional 15; }; node_93(){ required 82 45 48 86 89 90 91 92 26; }
node_94(){ either 28 16; }; node_95(){ required 94; }; node_96(){
required 82 45 27 49 95; }; node_97(){ optional 17; }; node_98(){ optional 18; }
node_99(){ optional 19; }; node_100(){ optional 20; }; node_101(){ optional 29
}; node_102(){ required 82 45 27 50 97 98 99 100 101; }; node_103(){
required 82 45 27 51; }; node_104(){ required 82 45 27 52; }; node_105(){
required 82 45 27 53; }; node_106(){ required 82 45 27 54 30 31; }; node_107(){
optional 28; }; node_108(){ required 82 45 27 55 107; }; node_109(){
required 82 45 27 56; }; node_110(){ required 82 45 27 57 95; }; node_111(){
either 58 59; }; node_112(){ required 111; }; node_113(){ optional 21; }
node_114(){ required 82 45 27 112 113 92; }; node_115(){ optional 32; }
node_116(){ required 82 45 27 57 28 115; }; node_117(){ optional 22; }
node_118(){ optional 23; }; node_119(){ oneormore 33; }; node_120(){
required 82 45 27 60 117 118 28 119; }; node_121(){ required 82 45 27 61 101; }
node_122(){ required 82 45 27 62 28; }; node_123(){ required 34 29; }
node_124(){ either 123 16; }; node_125(){ required 124; }; node_126(){
optional 35; }; node_127(){ required 82 45 27 63 64 125 126 91; }; node_128(){
required 82 45 27 63 65 34 29 36 91; }; node_129(){ either 34 16; }; node_130(){
required 129; }; node_131(){ required 82 45 27 63 112 130 91; }; node_132(){
required 82 45 27 66; }; node_133(){ required 82 45 27 67 47; }; node_134(){
either 37 16; }; node_135(){ required 134; }; node_136(){
required 82 45 27 67 112 135; }; node_137(){ optional 119; }; node_138(){
required 82 45 27 38 137; }; node_139(){ required 82 68 47; }; node_140(){
required 82 68 69 39; }; node_141(){ optional 24; }; node_142(){
required 82 68 39 70 98 141; }; node_143(){ required 82 68 39 71; }; node_144(){
required 82 68 39 72; }; node_145(){ optional 41; }; node_146(){ optional 42; }
node_147(){ required 82 73 74 40 145 146; }; node_148(){
required 82 73 48 43 75 33; }; node_149(){ required 82 73 84; }; node_150(){
required 82 73 40 58; }; node_151(){ required 82 73 40 76; }; node_152(){
required 82 73 40 77 85; }; node_153(){ optional 25; }; node_154(){
required 82 78 153; }; node_155(){ required 82 52; }; node_156(){ required 82 79
}; node_157(){ oneormore 44; }; node_158(){ optional 157; }; node_159(){
required 82 80 158; }; node_160(){ required 82; }; node_161(){
either 88 93 96 102 103 104 105 106 108 109 110 114 116 120 121 122 127 128 131 132 133 136 138 139 140 142 143 144 147 148 149 150 151 152 154 155 156 159 160
}; node_162(){ required 161; }; cat <<<' docopt_exit() {
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:368:1925}" >&2
exit 1; }'; unset var___env var___skip_check var___debug var___stack \
var___skip_update var___no_prompt var___branch var___verbose var___help \
var___status var___server var___type var___domain var___app_name var___pass \
var___secrets var___all var___update var___force var___fast var___chaos \
var___volumes var___no_tty var___user var___bump var___dev var__type_ \
var__app_ var__service_ var__version_ var__src_ var__dst_ var__backup_file_ \
var__args_ var__secret_ var__cmd_ var__data_ var__volume_ var__command_ \
var__recipe_ var__host_ var__user_ var__port_ var__provider_ var__subcommands_ \
var_app var_list var_ls var_new var_backup var_deploy var_check var_version \
var_config var_cp var_logs var_ps var_restore var_rm var_delete var_run \
var_rollback var_restart var_secret var_generate var_insert var_undeploy \
var_volume var_recipe var_create var_release var_lint var_versions var_server \
var_add var___ var_init var_apps var_upgrade var_doctor var_help; parse 162 "$@"
local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__env" \
"${prefix}__skip_check" "${prefix}__debug" "${prefix}__stack" \
"${prefix}__skip_update" "${prefix}__no_prompt" "${prefix}__branch" \
"${prefix}__verbose" "${prefix}__help" "${prefix}__status" "${prefix}__server" \
"${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2824}
usage=${DOC:368:1887}; digest=6ab46
shorts=(-n -b -v -U -e -h -d -C -s '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
longs=(--no-prompt --branch --verbose --skip-update --env --help --debug --skip-check --stack --status --server --type --domain --app-name --pass --secrets --all --update --force --fast --chaos --volumes --no-tty --user --bump --dev)
argcounts=(0 1 0 0 1 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0); node_0(){
switch __no_prompt 0; }; node_1(){ value __branch 1; }; node_2(){
switch __verbose 2; }; node_3(){ switch __skip_update 3; }; node_4(){
value __env 4; }; node_5(){ switch __help 5; }; node_6(){ switch __debug 6; }
node_7(){ switch __skip_check 7; }; node_8(){ value __stack 8; }; node_9(){
switch __status 9; }; node_10(){ value __server 10; }; node_11(){
value __type 11; }; node_12(){ value __domain 12; }; node_13(){
value __app_name 13; }; node_14(){ switch __pass 14; }; node_15(){
switch __secrets 15; }; node_16(){ switch __all 16; }; node_17(){
switch __update 17; }; node_18(){ switch __force 18; }; node_19(){
switch __fast 19; }; node_20(){ switch __chaos 20; }; node_21(){
switch __volumes 21; }; node_22(){ switch __no_tty 22; }; node_23(){
value __user 23; }; node_24(){ switch __bump 24; }; node_25(){ switch __dev 25
}; node_26(){ value _type_ a; }; node_27(){ value _app_ a; }; node_28(){
value _service_ a; }; node_29(){ value _version_ a; }; node_30(){ value _src_ a
}; node_31(){ value _dst_ a; }; node_32(){ value _backup_file_ a; }; node_33(){
value _args_ a true; }; node_34(){ value _secret_ a; }; node_35(){ value _cmd_ a
}; node_36(){ value _data_ a; }; node_37(){ value _volume_ a; }; node_38(){
value _command_ a; }; node_39(){ value _recipe_ a; }; node_40(){ value _host_ a
}; node_41(){ value _user_ a; }; node_42(){ value _port_ a; }; node_43(){
value _provider_ a; }; node_44(){ value _subcommands_ a true; }; node_45(){
_command app; }; node_46(){ _command list; }; node_47(){ _command ls; }
node_48(){ _command new; }; node_49(){ _command backup; }; node_50(){
_command deploy; }; node_51(){ _command check; }; node_52(){ _command version; }
node_53(){ _command config; }; node_54(){ _command cp; }; node_55(){
_command logs; }; node_56(){ _command ps; }; node_57(){ _command restore; }
node_58(){ _command rm; }; node_59(){ _command delete; }; node_60(){
_command run; }; node_61(){ _command rollback; }; node_62(){ _command restart; }
node_63(){ _command secret; }; node_64(){ _command generate; }; node_65(){
_command insert; }; node_66(){ _command undeploy; }; node_67(){ _command volume
}; node_68(){ _command recipe; }; node_69(){ _command create; }; node_70(){
_command release; }; node_71(){ _command versions; }; node_72(){ _command server
}; node_73(){ _command add; }; node_74(){ _command __ --; }; node_75(){
_command init; }; node_76(){ _command apps; }; node_77(){ _command upgrade; }
node_78(){ _command doctor; }; node_79(){ _command help; }; node_80(){
optional 0 1 2 3 4 5 6 7 8; }; node_81(){ optional 80; }; node_82(){
either 46 47; }; node_83(){ required 82; }; node_84(){ optional 9; }; node_85(){
optional 10; }; node_86(){ optional 11; }; node_87(){ required 81 45 83 84 85 86
}; node_88(){ optional 12; }; node_89(){ optional 13; }; node_90(){ optional 14
}; node_91(){ optional 15; }; node_92(){ required 81 45 48 85 88 89 90 91 26; }
node_93(){ either 28 16; }; node_94(){ required 93; }; node_95(){
required 81 45 27 49 94; }; node_96(){ optional 17; }; node_97(){ optional 18; }
node_98(){ optional 19; }; node_99(){ optional 20; }; node_100(){ optional 29; }
node_101(){ required 81 45 27 50 96 97 98 99 100; }; node_102(){
required 81 45 27 51; }; node_103(){ required 81 45 27 52; }; node_104(){
required 81 45 27 53; }; node_105(){ required 81 45 27 54 30 31; }; node_106(){
optional 28; }; node_107(){ required 81 45 27 55 106; }; node_108(){
required 81 45 27 56; }; node_109(){ required 81 45 27 57 94; }; node_110(){
either 58 59; }; node_111(){ required 110; }; node_112(){ optional 21; }
node_113(){ required 81 45 27 111 112 91; }; node_114(){ optional 32; }
node_115(){ required 81 45 27 57 28 114; }; node_116(){ optional 22; }
node_117(){ optional 23; }; node_118(){ oneormore 33; }; node_119(){
required 81 45 27 60 116 117 28 118; }; node_120(){ required 81 45 27 61 100; }
node_121(){ required 81 45 27 62 28; }; node_122(){ required 34 29; }
node_123(){ either 122 16; }; node_124(){ required 123; }; node_125(){
optional 35; }; node_126(){ required 81 45 27 63 64 124 125 90; }; node_127(){
required 81 45 27 63 65 34 29 36 90; }; node_128(){ either 34 16; }; node_129(){
required 128; }; node_130(){ required 81 45 27 63 111 129 90; }; node_131(){
required 81 45 27 66; }; node_132(){ required 81 45 27 67 47; }; node_133(){
either 37 16; }; node_134(){ required 133; }; node_135(){
required 81 45 27 67 111 134; }; node_136(){ optional 118; }; node_137(){
required 81 45 27 38 136; }; node_138(){ required 81 68 47; }; node_139(){
required 81 68 69 39; }; node_140(){ optional 24; }; node_141(){
required 81 68 39 70 97 140; }; node_142(){ required 81 68 39 71; }; node_143(){
optional 41; }; node_144(){ optional 42; }; node_145(){
required 81 72 73 40 143 144; }; node_146(){ required 81 72 48 43 74 33; }
node_147(){ required 81 72 83; }; node_148(){ required 81 72 40 58; }
node_149(){ required 81 72 40 75; }; node_150(){ required 81 72 40 76 84; }
node_151(){ optional 25; }; node_152(){ required 81 77 151; }; node_153(){
required 81 52; }; node_154(){ required 81 78; }; node_155(){ oneormore 44; }
node_156(){ optional 155; }; node_157(){ required 81 79 156; }; node_158(){
required 81; }; node_159(){
either 87 92 95 101 102 103 104 105 107 108 109 113 115 119 120 121 126 127 130 131 132 135 137 138 139 141 142 145 146 147 148 149 150 152 153 154 157 158
}; node_160(){ required 159; }; cat <<<' docopt_exit() {
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:368:1887}" >&2
exit 1; }'; unset var___no_prompt var___branch var___verbose var___skip_update \
var___env var___help var___debug var___skip_check var___stack var___status \
var___server var___type var___domain var___app_name var___pass var___secrets \
var___all var___update var___force var___fast var___chaos var___volumes \
var___no_tty var___user var___bump var___dev var__type_ var__app_ \
var__service_ var__version_ var__src_ var__dst_ var__backup_file_ var__args_ \
var__secret_ var__cmd_ var__data_ var__volume_ var__command_ var__recipe_ \
var__host_ var__user_ var__port_ var__provider_ var__subcommands_ var_app \
var_list var_ls var_new var_backup var_deploy var_check var_version var_config \
var_cp var_logs var_ps var_restore var_rm var_delete var_run var_rollback \
var_restart var_secret var_generate var_insert var_undeploy var_volume \
var_recipe var_create var_release var_versions var_server var_add var___ \
var_init var_apps var_upgrade var_doctor var_help; parse 160 "$@"
local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__no_prompt" \
"${prefix}__branch" "${prefix}__verbose" "${prefix}__skip_update" \
"${prefix}__env" "${prefix}__help" "${prefix}__debug" "${prefix}__skip_check" \
"${prefix}__stack" "${prefix}__status" "${prefix}__server" "${prefix}__type" \
"${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \
"${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \
"${prefix}__fast" "${prefix}__chaos" "${prefix}__volumes" "${prefix}__no_tty" \
"${prefix}__user" "${prefix}__bump" "${prefix}__dev" "${prefix}_type_" \
@ -289,17 +288,17 @@ local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__env" \
"${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}restart" \
"${prefix}secret" "${prefix}generate" "${prefix}insert" "${prefix}undeploy" \
"${prefix}volume" "${prefix}recipe" "${prefix}create" "${prefix}release" \
"${prefix}lint" "${prefix}versions" "${prefix}server" "${prefix}add" \
"${prefix}__" "${prefix}init" "${prefix}apps" "${prefix}upgrade" \
"${prefix}doctor" "${prefix}help"; eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
eval "${prefix}"'__debug=${var___debug:-false}'
eval "${prefix}"'__stack=${var___stack:-}'
eval "${prefix}"'__skip_update=${var___skip_update:-false}'
eval "${prefix}"'__no_prompt=${var___no_prompt:-false}'
"${prefix}versions" "${prefix}server" "${prefix}add" "${prefix}__" \
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}doctor" \
"${prefix}help"; eval "${prefix}"'__no_prompt=${var___no_prompt:-false}'
eval "${prefix}"'__branch=${var___branch:-}'
eval "${prefix}"'__verbose=${var___verbose:-false}'
eval "${prefix}"'__skip_update=${var___skip_update:-false}'
eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__help=${var___help:-false}'
eval "${prefix}"'__debug=${var___debug:-false}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
eval "${prefix}"'__stack=${var___stack:-}'
eval "${prefix}"'__status=${var___status:-false}'
eval "${prefix}"'__server=${var___server:-}'
eval "${prefix}"'__type=${var___type:-}'
@ -359,7 +358,6 @@ eval "${prefix}"'volume=${var_volume:-false}'
eval "${prefix}"'recipe=${var_recipe:-false}'
eval "${prefix}"'create=${var_create:-false}'
eval "${prefix}"'release=${var_release:-false}'
eval "${prefix}"'lint=${var_lint:-false}'
eval "${prefix}"'versions=${var_versions:-false}'
eval "${prefix}"'server=${var_server:-false}'
eval "${prefix}"'add=${var_add:-false}'; eval "${prefix}"'__=${var___:-false}'
@ -369,9 +367,9 @@ eval "${prefix}"'upgrade=${var_upgrade:-false}'
eval "${prefix}"'doctor=${var_doctor:-false}'
eval "${prefix}"'help=${var_help:-false}'; local docopt_i=1
[[ $BASH_VERSION =~ ^4.3 ]] && docopt_i=2; for ((;docopt_i>0;docopt_i--)); do
declare -p "${prefix}__env" "${prefix}__skip_check" "${prefix}__debug" \
"${prefix}__stack" "${prefix}__skip_update" "${prefix}__no_prompt" \
"${prefix}__branch" "${prefix}__verbose" "${prefix}__help" "${prefix}__status" \
declare -p "${prefix}__no_prompt" "${prefix}__branch" "${prefix}__verbose" \
"${prefix}__skip_update" "${prefix}__env" "${prefix}__help" "${prefix}__debug" \
"${prefix}__skip_check" "${prefix}__stack" "${prefix}__status" \
"${prefix}__server" "${prefix}__type" "${prefix}__domain" \
"${prefix}__app_name" "${prefix}__pass" "${prefix}__secrets" "${prefix}__all" \
"${prefix}__update" "${prefix}__force" "${prefix}__fast" "${prefix}__chaos" \
@ -388,9 +386,9 @@ declare -p "${prefix}__env" "${prefix}__skip_check" "${prefix}__debug" \
"${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}restart" \
"${prefix}secret" "${prefix}generate" "${prefix}insert" "${prefix}undeploy" \
"${prefix}volume" "${prefix}recipe" "${prefix}create" "${prefix}release" \
"${prefix}lint" "${prefix}versions" "${prefix}server" "${prefix}add" \
"${prefix}__" "${prefix}init" "${prefix}apps" "${prefix}upgrade" \
"${prefix}doctor" "${prefix}help"; done; }
"${prefix}versions" "${prefix}server" "${prefix}add" "${prefix}__" \
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}doctor" \
"${prefix}help"; done; }
# docopt parser above, complete command for generating this parser is `docopt.sh abra`
PROGRAM_NAME=$(basename "$0")
@ -548,8 +546,8 @@ require_plugin() {
fi
# shellcheck disable=SC2086
if ! git clone ${git_extra_args:-} "$GIT_URL$PLUGIN.git" "$ABRA_DIR/plugins/$PLUGIN" > /dev/null 2>&1 ; then
error "Could not retrieve the plugin '$PLUGIN' from '$GIT_URL$PLUGIN.git' to '$ABRA_DIR/plugins/$PLUGIN', does it exist?"
if ! git clone ${git_extra_args:-} "$GIT_URL/$PLUGIN.git" "$ABRA_DIR/plugins/$PLUGIN" > /dev/null 2>&1 ; then
error "Could not retrieve the $PLUGIN plugin, does it exist?"
fi
if [[ $(cd "$ABRA_DIR/plugins/$PLUGIN" && git branch --list | wc -l) == "0" ]]; then
@ -679,6 +677,11 @@ pwqgen_native() {
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
get_recipes() {
@ -697,7 +700,7 @@ get_recipe_versions() {
if [ "$recipe_json" = "null" ]; then
declare -a RECIPE_VERSIONS
else
mapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | .[] | keys | add")
mapfile -t RECIPE_VERSIONS < <(echo "$recipe_json" | $JQ -r ".versions | keys | .[]" - | sort)
fi
}
@ -832,7 +835,7 @@ ensure_stack_deployed() {
for service in $(docker ps -f "name=$STACK_NAME" -q); do
debug "Polling $service for deployment status"
healthcheck=$(docker inspect --format "{{ json .State }}" "$service" | $JQ "try(.Health.Status // \"missing\")")
healthcheck=$(docker inspect --format "{{ json .State }}" "$service" | jq "try(.Health.Status // \"missing\")")
name=$(docker inspect --format '{{ index .Config.Labels "com.docker.swarm.service.name" }}' "$service")
if [[ ${MISSING[*]} =~ ${name} ]] || [[ ${HEALTHY[*]} =~ ${name} ]]; then
@ -1055,84 +1058,92 @@ POWERED BY (for --status)
}
sub_app_list (){
SERVER="$abra___server"
if [ -z "$SERVER" ]; then
SERVER='*'
local server="$abra___server"
if [ -z "$server" ]; then
server='*'
fi
shopt -s nullglob dotglob
# shellcheck disable=SC2206
ENV_FILES=($ABRA_DIR/servers/$SERVER/*.env)
env_files=($ABRA_DIR/servers/$server/*.env)
shopt -u nullglob dotglob
STATUS="$( [[ $abra___status == "true" ]] && echo "Y" )"
status="$( [[ $abra___status == "true" ]] && echo "Y" )"
if [ -n "$STATUS" ]; then
if [ "$SERVER" = "*" ]; then
if [ -n "$status" ]; then
if [ "$server" = "*" ]; then
get_servers
else
SERVERS=( "$SERVER" )
servers=( "$SERVER" )
fi
local -a DEPLOYED_APPS # array
local -a CHECKED_SERVERS # array
local -a deployed_apps # array
local -a checked_servers # array
warning "Loading status from ${#SERVERS[@]} server(s), patience advised.."
warning "Loading status from ${#servers[@]} server(s), patience advised.."
if [ "$abra___versions" == "true" ]; then
warning "Also looking up container versions. Maybe go for a walk."
fi
for SERVER in "${SERVERS[@]}"; do
SERVER="${SERVER##*/}" # basename
mapfile -t SERVER_APPS < <(DOCKER_CONTEXT="$SERVER" docker stack ls --format '{{ .Name }}' 2>/dev/null)
# add $SERVER~ to the start of each DEPLOYED_APPS
DEPLOYED_APPS+=("${SERVER_APPS[@]/#/$SERVER~}")
for server in "${servers[@]}"; do
server="${server##*/}" # basename
mapfile -t server_apps < <(DOCKER_CONTEXT="$SERVER" docker stack ls --format '{{ .Name }}' 2>/dev/null)
#if [ "$abra___versions" == "true" ]; then
# filter="{{index .Spec.Labels \"coop-cloud.*.$SERVICE.version\" }}"
# labels=$(docker service inspect -f "$filter" "" 2>/dev/null)
#else
# add $server~ to the start of each DEPLOYED_APPS
deployed_apps+=("${server_apps[@]/#/$server~}")
#fi
done
fi
# FIXME 3wc: doesn't take into account --type filtering
printf "%s lovely apps:\n\n" "${#ENV_FILES[@]}"
printf "%s lovely apps:\n\n" "${#env_files[@]}"
for i in "${!ENV_FILES[@]}"; do
for i in "${!env_files[@]}"; do
# Output header inside the loop, so it's included in the pipe to `column`
if [ "$i" == 0 ]; then
printf " DOMAIN\tTYPE\tSERVER%s%s\n" "${STATUS:+ }" "${STATUS:+STATUS}"
printf " --\t--\t--%s\n" "${STATUS:+ --}"
printf " DOMAIN\tTYPE\tserver%s%s\n" "${status:+ }" "${status:+status}"
printf " --\t--\t--%s\n" "${status:+ --}"
fi
local ENV_FILE="${ENV_FILES[$i]}" APP_STACK_NAME
local env_file="${env_files[$i]}" app_stack_name
IFS='/' read -r -a PARTS <<< "$ENV_FILE"
IFS='/' read -r -a parts <<< "$env_file"
FILE="${PARTS[-1]}"
SERVER="${PARTS[-2]}"
DOMAIN="${FILE%.env}"
env_file="${parts[-1]}"
server="${parts[-2]}"
domain="${env_file%.env}"
set -a
# shellcheck disable=SC1090
TYPE="$(source "$ENV_FILE" && echo "$TYPE")"
app_type="$(source "$env_file" && echo "$TYPE")"
# shellcheck disable=SC1090
APP_STACK_NAME="$(source "$ENV_FILE" && echo "$STACK_NAME")"
app_stack_name="$(source "$env_file" && echo "$STACK_NAME")"
set +a
if [ "$abra___type" != "" ] && [ "$abra___type" != "$TYPE" ]; then
if [ "$abra___type" != "" ] && [ "$abra___type" != "$app_type" ]; then
continue
fi
if [ -z "$APP_STACK_NAME" ]; then
APP_STACK_NAME="${DOMAIN//./_}"
if [ -z "$app_stack_name" ]; then
app_stack_name="${domain//./_}"
fi
if [ -n "$STATUS" ]; then
APP_STATUS=$( printf '%s\n' "${DEPLOYED_APPS[@]}" | grep -qP "^${SERVER}~${APP_STACK_NAME}$" && echo "deployed" || echo "inactive")
if [[ "$APP_STATUS" == "inactive" ]] ; then
if [[ ${CHECKED_SERVERS[*]} =~ ${SERVER} ]]; then
APP_STATUS="unknown"
if [ -n "$status" ]; then
app_status=$( printf '%s\n' "${deployed_apps[@]}" | grep -qP "^${server}~${app_stack_name}$" && echo "deployed" || echo "inactive")
if [[ "$app_status" == "inactive" ]] ; then
if [[ ${checked_servers[*]} =~ ${server} ]]; then
app_status="unknown"
else
if ! docker context inspect "$SERVER" > /dev/null 2>&1; then
APP_STATUS="unknown"
if ! docker context inspect "$server" > /dev/null 2>&1; then
app_status="unknown"
fi
CHECKED_SERVERS+=("$SERVER")
checked_servers+=("$server")
fi
fi
fi
printf " %s\t%s\t%s%s\n" "$DOMAIN" "$TYPE" "$SERVER" "${STATUS:+ }${APP_STATUS}"
printf " %s\t%s\t%s%s\n" "$domain" "$app_type" "$server" "${status:+ }${app_status}"
done | column -s' ' -t
# Align table `-t` based on tab characters -s`^V<Tab>`
}
@ -1714,7 +1725,7 @@ sub_app_secret_generate(){
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 "Abra is not able to show the password values in plain text again"
warning "See https://docs.coopcloud.tech/secrets/ for more on secrets"
warning "See https://docs.cloud.autonomic.zone/secrets/ for more on secrets"
msg_already_outputted="true"
fi
@ -1858,15 +1869,14 @@ sub_app_run(){
fi
debug "Using container ID ${CONTAINER}"
# shellcheck disable=SC2145
debug "Running command: docker exec $RUN_USER $ARGS $CONTAINER $@"
exit
# shellcheck disable=SC2086
docker exec $RUN_USER $ARGS "$CONTAINER" "$@"
# shellcheck disable=SC2181
if [[ $? != 0 ]]; then exit 1; fi
if ! docker exec $RUN_USER $ARGS "$CONTAINER" "$@"; then
exit 1
fi
return
}
@ -2119,126 +2129,6 @@ sub_recipe_versions() {
done
}
###### .. recipe <recipe> lint
help_recipe_lint() {
echo "abra [options] recipe <recipe> lint
(For recipe maintainers)
Check for various Docker and Co-op Cloud best-practices.
POWERED BY
yq"
}
sub_recipe_lint() {
require_yq
local recipe
recipe="$abra__recipe_"
local recipe_dir
recipe_dir="$ABRA_DIR/apps/$recipe"
local compose_file
compose_file="compose.yml"
cd "$recipe_dir" || error "Can't find recipe dir '$recipe_dir'"
local app_data
app_data=$($YQ e '.services.app' "$compose_file")
# Check for an "app" service
if [ "$app_data" = "null" ]; then
warning "Missing 'app' service"
else
info "'app' service found"
fi
# Check that at least one service has Traefik enabled
if $YQ e '.services.*.deploy.labels.[] == "traefik.enable=true"' "$compose_file" | grep -q true; then
info "Found at least one Traefik-enabled service"
else
warning "Can't find any Traefik-enabled service"
fi
# Healthcheck check (check)
if $YQ e -e '.services.*.healthcheck' "$compose_file" > /dev/null 2>&1; then
info "Found a healthcheck for at least one service."
else
warning "Can't find any healthchecks."
fi
# Verify compose version
local compose_version
compose_version=$($YQ e '.version' "$compose_file")
if [ "$compose_version" = "3.8" ]; then
info "Compose version 3.8"
else
warning "Compose version $compose_version, should be 3.8."
fi
local image_tags
image_tags=$($YQ e '.services.*.image' "$compose_file")
# Check that each image is using a tag
local untagged_images
untagged_images=$(grep '^[^:]*$' <<< "$image_tags")
if [ -n "$untagged_images" ]; then
warning "Untagged images found: $untagged_images"
else
info "No untagged images found"
fi
# Check no images are using "latest"
local latest_images
latest_images=$(grep ':latest' <<< "$image_tags")
if [ -n "$latest_images" ]; then
warning "Images found using 'latest': $latest_images"
else
info "No 'latest' images found"
fi
# Check for .env.sample
if [ -f .env.sample ]; then
info "Found .env.sample"
else
warning "No .env.sample"
fi
local service_configs
service_configs=$($YQ e '.services.*.configs' "$compose_file")
if grep -v "null" -q <<< "$service_configs"; then
# Check for .env.sample
if [ -f abra.sh ]; then
info "Found abra.sh"
else
warning "No abra.sh, but config vars defined"
fi
fi
# Check for .drone.yml
if [ -f .drone.yml ]; then
info "Found .drone.yml"
# Check for stack-ssh-deploy CI
if $YQ e -e '.steps.[] | select(.image == "decentral1se/stack-ssh-deploy:latest")' .drone.yml > /dev/null 2>&1; then
info "Found abra auto-release"
else
warning "Missing drone-abra auto-release"
fi
# Check for drone-abra auto-release
if $YQ e -e '.steps.[] | select(.image == "decentral1se/drone-abra:latest")' .drone.yml > /dev/null 2>&1; then
info "Found abra auto-release"
else
warning "Missing drone-abra auto-release"
fi
else
warning "No .drone.yml"
fi
}
###### .. recipe <recipe> release
help_recipe_release() {
echo "abra [options] recipe <recipe> release [--force] [--bump]
@ -2579,7 +2469,7 @@ sub_server_new() {
PROVIDER="$abra__provider_"
if [ "$PROVIDER" != "hetzner" ] && [ "$PROVIDER" != "capsul" ]; then
if [ "$PROVIDER" != "hetzner" ]; then
error "Unknown provider plugin 'abra-${PROVIDER}'"
fi
@ -2650,7 +2540,7 @@ sub_upgrade() {
if [[ "$abra___dev" == "true" ]]; then
curl https://install.abra.coopcloud.tech | bash -s -- --dev --no-deps
else
curl https://install.abra.coopcloud.tech | bash -s -- --no-deps
curl https://install.abra.coopcloud.tech | bash --no-deps
fi
}

View File

@ -14,15 +14,12 @@ HOME_PATH = expanduser("~/")
CLONES_PATH = Path(f"{HOME_PATH}/.abra/apps").absolute()
REPOS_TO_SKIP = (
"abra",
"abra-aur",
"abra-apps",
"abra-capsul",
"abra-gandi",
"abra-hetzner",
"apps",
"auto-apps-json",
"auto-mirror",
"aur-abra-git",
"backup-bot",
"coopcloud.tech",
"coturn",
@ -31,11 +28,9 @@ REPOS_TO_SKIP = (
"docs.coopcloud.tech",
"example",
"gardening",
"go-abra",
"organising",
"pyabra",
"radicle-seed-node",
"tagcmp",
"stack-ssh-deploy",
"swarm-cronjob",
"tyop",
@ -66,7 +61,7 @@ def _run_cmd(cmd, shell=False, **kwargs):
def get_repos_json():
""" Retrieve repo list from Gitea """
url = "https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos"
url = "https://git.autonomic.zone/api/v1/orgs/coop-cloud/repos"
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):
versions = []
versions = {}
chdir(app_path)
@ -206,7 +206,7 @@ def get_app_versions(app_path, cached_apps_json):
parsed_services.append(service)
versions.append({tag: service_versions})
versions[tag] = service_versions
_run_cmd(f"git checkout {initial_branch}")

View File

@ -2,8 +2,8 @@
# shellcheck disable=SC2154,SC2034
ABRA_VERSION="10.0.5"
GIT_URL="https://git.coopcloud.tech/coop-cloud/abra"
ABRA_VERSION="10.0.0"
GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
@ -161,8 +161,7 @@ function install_requirements {
sudo apt update && sudo apt install -y \
passwdqc \
pwgen \
git
pwgen
echo "Install Docker (https://docs.docker.com/engine/install/debian/)?"
prompt_confirm
@ -170,7 +169,7 @@ function install_requirements {
else
echo "Sorry, we only support Debian based distributions at the moment"
echo "You'll have to install the requirements manually for your distribution"
echo "See https://git.coopcloud.tech/coop-cloud/abra#requirements for more"
echo "See https://git.autonomic.zone/coop-cloud/abra#requirements for more"
fi
}