Compare commits

...

20 Commits

Author SHA1 Message Date
3wc
5d84cef63c app restore 2021-01-09 13:36:32 +02:00
3wc
eda5198904 Add scaffolding for per-app backup commands
See #70
2021-01-09 13:36:32 +02:00
3wc
a4a3dccd66 Add global --skip-check / --skip-update commands 2021-01-09 13:36:32 +02:00
3wc
a2d249e3a1 Fix abra app ls with * server 2021-01-02 00:34:44 +02:00
dc83baea12 Remove tab 2021-01-01 22:44:21 +01:00
3wc
d6b4a4744f Fix abra app ls for app → type 2021-01-01 23:00:20 +02:00
6ba2657dc1 Use short hash convention 2021-01-01 18:59:19 +01:00
ac6b805cbf Follow parens convention 2021-01-01 18:57:39 +01:00
d4e52a9de3 Merge pull request 'Make secret generation more robust' (#73) from simplify-secret-logic into main
Reviewed-on: https://git.autonomic.zone/coop-cloud/abra/pulls/73
2021-01-01 18:55:47 +01:00
aa59c1ad43 Make secret generation more robust
Closes https://git.autonomic.zone/coop-cloud/abra/issues/68.
2021-01-01 18:54:41 +01:00
36f1d679ae Merge pull request 'Merging auto functionality into generate command' (#64) from app-auto-merge into main
Reviewed-on: https://git.autonomic.zone/coop-cloud/abra/pulls/64
2021-01-01 17:32:30 +01:00
f5c8ee1136 Merge auto/generate and use --secrets
Closes https://git.autonomic.zone/coop-cloud/abra/issues/58.
2021-01-01 17:31:21 +01:00
3wc
9a17817cc8 Tiny tweak to abra help advice 2021-01-01 17:57:36 +02:00
3wc
b2e3292453 Add version subcommand to CHANGELOG 2021-01-01 17:55:45 +02:00
13fafb5929 Fix typo and link to commit 2021-01-01 14:18:30 +01:00
3wc
114f99ae2e Update CHANGELOG 2021-01-01 15:11:04 +02:00
3wc
fff4b10a41 Gettin some help_
See #50
2021-01-01 15:09:49 +02:00
ab1353603d Use homebrewed image for CI too 2021-01-01 13:49:19 +01:00
1600b6277f Use the One True Way for testing
Closes https://git.autonomic.zone/coop-cloud/abra/issues/71.
2021-01-01 13:48:14 +01:00
b79e35f982 Merge pull request 'Add per-subcommand help using abra help <subcommand>' (#61) from command_help_2 into main
Reviewed-on: https://git.autonomic.zone/coop-cloud/abra/pulls/61
2021-01-01 13:13:29 +01:00
5 changed files with 457 additions and 203 deletions

View File

@ -8,20 +8,18 @@ steps:
- shellcheck abra
- name: run unit tests
image: docker:dind
image: decentral1se/docker-dind-bats-kcov
commands:
- apk add bats git bash
- bats tests
- name: collect code coverage
failure: ignore # until we fix this
image: kcov/kcov:38
failure: ignore # until we fix this
image: decentral1se/docker-dind-bats-kcov
commands:
- apt update && apt install -y bats git bash
- kcov . bats tests || true
- name: send code coverage report to codecov
failure: ignore # until we fix this
failure: ignore # until we fix this
image: plugins/codecov
settings:
token:

View File

@ -1,18 +1,26 @@
# abra x.x.x (UNRELEASED)
- `secret auto` merged into `secret generate` and `app new --auto` is now `app new --secrets` ([#64](https://git.autonomic.zone/coop-cloud/abra/pulls/64))
- Avoid outputting length during secret generation when not in use ([#67](https://git.autonomic.zone/coop-cloud/abra/issues/67))
- Support graceful failure when missing secret generation commands ([44d3ac3a1cb86edc9b9e91eea1a00e70eae14965](https://git.autonomic.zone/coop-cloud/abra/commit/44d3ac3a1cb86edc9b9e91eea1a00e70eae14965))
- Fix secret detection when using new `.env` file format in apps ([55324524ca77141666ffe6cc41b62cc71cf89ace](https://git.autonomic.zone/coop-cloud/abra/commit/55324524ca77141666ffe6cc41b62cc71cf89ace))
- Support choosing an `$EDITOR` when editing configs ([29cc392dff3e93e48e0e2edd3ce11b405c66a95a](https://git.autonomic.zone/coop-cloud/abra/commit/29cc392dff3e93e48e0e2edd3ce11b405c66a95a))
- "server" shell completion fixed ([8839bd45951d00dccf4ef81ece445bcc49e13ee6](https://git.autonomic.zone/coop-cloud/abra/commit/8839bd45951d00dccf4ef81ece445bcc49e13ee6))
- Make `-v` spit out the version ([0179f600f5ce40fc1520fc365f92b7cb6eeec1f5](https://git.autonomic.zone/coop-cloud/abra/commit/0179f600f5ce40fc1520fc365f92b7cb6eeec1f5))
- Support graceful failure when missing secret generation commands ([44d3ac3](https://git.autonomic.zone/coop-cloud/abra/commit/44d3ac3a1cb86edc9b9e91eea1a00e70eae14965))
- Fix secret detection when using new `.env` file format in apps ([5532452](https://git.autonomic.zone/coop-cloud/abra/commit/55324524ca77141666ffe6cc41b62cc71cf89ace))
- Support choosing an `$EDITOR` when editing configs ([29cc392](https://git.autonomic.zone/coop-cloud/abra/commit/29cc392dff3e93e48e0e2edd3ce11b405c66a95a))
- "server" shell completion fixed ([8839bd4](https://git.autonomic.zone/coop-cloud/abra/commit/8839bd45951d00dccf4ef81ece445bcc49e13ee6))
- Drop `multilogs` command ([#56](https://git.autonomic.zone/coop-cloud/abra/pulls/56))
- Remove `server use` command ([#51](https://git.autonomic.zone/coop-cloud/abra/issues/51))
- `new <app>` becomes `new <type>` ([#48](https://git.autonomic.zone/coop-cloud/abra/issues/48))
- `check` is run on `deploy` now and configurable ([77ba5652b2fe15820f5edfa0f642636f7b8eae7e](https://git.autonomic.zone/coop-cloud/abra/commit/77ba5652b2fe15820f5edfa0f642636f7b8eae7e))
- `check` is run on `deploy` now and configurable ([77ba565](https://git.autonomic.zone/coop-cloud/abra/commit/77ba5652b2fe15820f5edfa0f642636f7b8eae7e))
- App configurations are always updated now ([#42](https://git.autonomic.zone/coop-cloud/abra/issues/42))
- We use docker format `.env` files (no "export" syntax) from now now ([#55](https://git.autonomic.zone/coop-cloud/abra/pulls/55))
- Rename `<domain>` option to `<app>` and `APP` variable to `TYPE`, see [#47](https://git.autonomic.zone/coop-cloud/abra/pulls/55)
- Rename `<domain>` option to `<app>` and `APP` variable to `TYPE`, see ([#47](https://git.autonomic.zone/coop-cloud/abra/issues/47))
- Use Docker-in-Docker (dind), and `dind-bats-kcov` Docker image, for `make test` ([1600b62](https://git.autonomic.zone/coop-cloud/abra/commit/1600b6277fbbffc4c6de1e4ba799c7bbe72ec6a0))
- Add built-in documentation using `abra help <subcommand>...`, see ([#50](https://git.autonomic.zone/coop-cloud/abra/issues/50))
- `version` subcommand ([e6b24fe](https://git.autonomic.zone/coop-cloud/abra/commit/e6b24fe))
- Use `# length=x` comments to generate passwords with `pwgen` and drop `KEY`/`PASSWORD` logic ([#68](https://git.autonomic.zone/coop-cloud/abra/issues/68))
- Global `--skip-update` / `--skip-check` options to make things quicker,
[37e8b00](https://git.autonomic.zone/coop-cloud/abra/commit/37e8b00)
- `app backup` and `app restore` commands; requires per-app definition -- see
[#70](https://git.autonomic.zone/coop-cloud/abra/issues/70)
# abra 0.4.1 (2020-12-24)

View File

@ -1,6 +1,6 @@
.PHONY: test shellcheck docopt kcov codecov
test_dind:
test:
@sudo DOCKER_CONTEXT=default docker run \
-v $$(pwd):/workdir \
--privileged \
@ -15,17 +15,6 @@ test_dind:
@DOCKER_CONTEXT=default docker stop abra-test-dind
@DOCKER_CONTEXT=default docker rm abra-test-dind
test_docker:
@DOCKER_CONTEXT=default docker run \
-it \
--rm \
-v $$(pwd):/workdir \
decentral1se/docker-dind-bats-kcov \
sh -c "cd /workdir && bats /workdir/tests"
test_local:
bats tests
shellcheck:
@docker run \
-it \

613
abra
View File

@ -12,21 +12,23 @@ DOC="
The cooperative cloud utility belt 🎩🐇
Usage:
abra [options] app new [--server=<server>] [--domain=<domain>] [--app-name=<app_name>] [--pass] [--auto] <type>
abra [options] app (list|ls) [--status] [--server=<server>]
abra [options] app <app> deploy [--skip-check]
abra [options] app <app> undeploy
abra [options] app <app> config
abra [options] app <app> (delete|rm) [--force]
abra [options] app <app> logs [<service>]
abra [options] app <app> cp <src> <dst>
abra [options] app new [--server=<server>] [--domain=<domain>] [--app-name=<app_name>] [--pass] [--secrets] <type>
abra [options] app <app> backup (<service>|--all)
abra [options] app <app> deploy
abra [options] app <app> check
abra [options] app <app> config
abra [options] app <app> cp <src> <dst>
abra [options] app <app> logs [<service>]
abra [options] app <app> ps
abra [options] app <app> restore (<service>|--all)
abra [options] app <app> (rm|delete) [--force]
abra [options] app <app> restore <service> [<backup file>]
abra [options] app <app> run [--no-tty] [--user=<user>] <service> <args>...
abra [options] app <app> secret auto [--pass]
abra [options] app <app> secret generate <secret> <version> [<cmd>] [--pass]
abra [options] app <app> secret generate (<secret> <version>|--all) [<cmd>] [--pass]
abra [options] app <app> secret insert <secret> <version> <data> [--pass]
abra [options] app <app> secret (delete|rm) (<secret>|--all) [--pass] [--force]
abra [options] app <app> secret (rm|delete) (<secret>|--all) [--pass] [--force]
abra [options] app <app> undeploy
abra [options] app <app> <command> [<args>...]
abra [options] server add <host> [<user>] [<port>]
abra [options] server (list|ls)
@ -41,8 +43,10 @@ Options:
-e, --env=<path> Environment variables to load
-h, --help Show this message and exit
-s, --stack=<stack> Name of the target stack
-C, --skip-check Don't verify app variables
-U, --skip-update Don't pull latest app definitions
See 'abra help <command>' to read about a specific subcommand.
See 'abra help <subcommands>...' to read about a specific subcommand.
"
# docopt parser below, refresh this parser with `docopt.sh abra`
@ -144,97 +148,107 @@ 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:1470}
usage=${DOC:40:1206}; digest=b4523
shorts=(-h -e -s '' '' '' '' '' '' '' '' '' '' '')
longs=(--help --env --stack --server --domain --app-name --pass --auto --status --skip-check --force --no-tty --user --all)
argcounts=(0 1 1 1 1 1 0 0 0 0 0 0 1 0); node_0(){ switch __help 0; }; node_1(){
value __env 1; }; node_2(){ value __stack 2; }; node_3(){ value __server 3; }
node_4(){ value __domain 4; }; node_5(){ value __app_name 5; }; node_6(){
switch __pass 6; }; node_7(){ switch __auto 7; }; node_8(){ switch __status 8; }
node_9(){ switch __skip_check 9; }; node_10(){ switch __force 10; }; node_11(){
switch __no_tty 11; }; node_12(){ value __user 12; }; node_13(){ switch __all 13
}; node_14(){ value _type_ a; }; node_15(){ value _app_ a; }; node_16(){
value _service_ a; }; node_17(){ value _src_ a; }; node_18(){ value _dst_ a; }
node_19(){ value _args_ a true; }; node_20(){ value _secret_ a; }; node_21(){
value _version_ a; }; node_22(){ value _cmd_ a; }; node_23(){ value _data_ a; }
node_24(){ value _command_ a; }; node_25(){ value _host_ a; }; node_26(){
value _user_ a; }; node_27(){ value _port_ a; }; node_28(){
value _subcommands_ a true; }; node_29(){ _command app; }; node_30(){
_command new; }; node_31(){ _command list; }; node_32(){ _command ls; }
node_33(){ _command deploy; }; node_34(){ _command undeploy; }; node_35(){
_command config; }; node_36(){ _command delete; }; node_37(){ _command rm; }
node_38(){ _command logs; }; node_39(){ _command cp; }; node_40(){
_command check; }; node_41(){ _command ps; }; node_42(){ _command run; }
node_43(){ _command secret; }; node_44(){ _command auto; }; node_45(){
_command generate; }; node_46(){ _command insert; }; node_47(){ _command server
}; node_48(){ _command add; }; node_49(){ _command init; }; node_50(){
_command apps; }; node_51(){ _command upgrade; }; node_52(){ _command version; }
node_53(){ _command help; }; node_54(){ optional 0 1 2; }; node_55(){
optional 54; }; node_56(){ optional 3; }; node_57(){ optional 4; }; node_58(){
optional 5; }; node_59(){ optional 6; }; node_60(){ optional 7; }; node_61(){
required 55 29 30 56 57 58 59 60 14; }; node_62(){ either 31 32; }; node_63(){
required 62; }; node_64(){ optional 8; }; node_65(){ required 55 29 63 64 56; }
node_66(){ optional 9; }; node_67(){ required 55 29 15 33 66; }; node_68(){
required 55 29 15 34; }; node_69(){ required 55 29 15 35; }; node_70(){
either 36 37; }; node_71(){ required 70; }; node_72(){ optional 10; }
node_73(){ required 55 29 15 71 72; }; node_74(){ optional 16; }; node_75(){
required 55 29 15 38 74; }; node_76(){ required 55 29 15 39 17 18; }; node_77(){
required 55 29 15 40; }; node_78(){ required 55 29 15 41; }; node_79(){
optional 11; }; node_80(){ optional 12; }; node_81(){ oneormore 19; }
node_82(){ required 55 29 15 42 79 80 16 81; }; node_83(){
required 55 29 15 43 44 59; }; node_84(){ optional 22; }; node_85(){
required 55 29 15 43 45 20 21 84 59; }; node_86(){
required 55 29 15 43 46 20 21 23 59; }; node_87(){ either 20 13; }; node_88(){
required 87; }; node_89(){ required 55 29 15 43 71 88 59 72; }; node_90(){
optional 81; }; node_91(){ required 55 29 15 24 90; }; node_92(){ optional 26; }
node_93(){ optional 27; }; node_94(){ required 55 47 48 25 92 93; }; node_95(){
required 55 47 63; }; node_96(){ required 55 47 25 37; }; node_97(){
required 55 47 25 49; }; node_98(){ required 55 47 25 50 64; }; node_99(){
required 55 51; }; node_100(){ required 55 52; }; node_101(){ oneormore 28; }
node_102(){ optional 101; }; node_103(){ required 55 53 102; }; node_104(){
either 61 65 67 68 69 73 75 76 77 78 82 83 85 86 89 91 94 95 96 97 98 99 100 103
}; node_105(){ required 104; }; cat <<<' docopt_exit() {
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1206}" >&2
exit 1; }'; unset var___help var___env var___stack var___server var___domain \
var___app_name var___pass var___auto var___status var___skip_check var___force \
var___no_tty var___user var___all var__type_ var__app_ var__service_ var__src_ \
var__dst_ var__args_ var__secret_ var__version_ var__cmd_ var__data_ \
var__command_ var__host_ var__user_ var__port_ var__subcommands_ var_app \
var_new var_list var_ls var_deploy var_undeploy var_config var_delete var_rm \
var_logs var_cp var_check var_ps var_run var_secret var_auto var_generate \
var_insert var_server var_add var_init var_apps var_upgrade var_version var_help
parse 105 "$@"; local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__help" \
"${prefix}__env" "${prefix}__stack" "${prefix}__server" "${prefix}__domain" \
"${prefix}__app_name" "${prefix}__pass" "${prefix}__auto" "${prefix}__status" \
"${prefix}__skip_check" "${prefix}__force" "${prefix}__no_tty" \
"${prefix}__user" "${prefix}__all" "${prefix}_type_" "${prefix}_app_" \
"${prefix}_service_" "${prefix}_src_" "${prefix}_dst_" "${prefix}_args_" \
"${prefix}_secret_" "${prefix}_version_" "${prefix}_cmd_" "${prefix}_data_" \
"${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \
"${prefix}_subcommands_" "${prefix}app" "${prefix}new" "${prefix}list" \
"${prefix}ls" "${prefix}deploy" "${prefix}undeploy" "${prefix}config" \
"${prefix}delete" "${prefix}rm" "${prefix}logs" "${prefix}cp" "${prefix}check" \
"${prefix}ps" "${prefix}run" "${prefix}secret" "${prefix}auto" \
"${prefix}generate" "${prefix}insert" "${prefix}server" "${prefix}add" \
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:1696}
usage=${DOC:40:1320}; digest=563d5
shorts=(-h -s -e -U -C '' '' '' '' '' '' '' '' '' '')
longs=(--help --stack --env --skip-update --skip-check --status --server --domain --app-name --pass --secrets --all --force --no-tty --user)
argcounts=(0 1 1 0 0 0 1 1 1 0 0 0 0 0 1); node_0(){ switch __help 0; }
node_1(){ value __stack 1; }; node_2(){ value __env 2; }; node_3(){
switch __skip_update 3; }; node_4(){ switch __skip_check 4; }; node_5(){
switch __status 5; }; node_6(){ value __server 6; }; node_7(){ value __domain 7
}; node_8(){ value __app_name 8; }; node_9(){ switch __pass 9; }; node_10(){
switch __secrets 10; }; node_11(){ switch __all 11; }; node_12(){
switch __force 12; }; node_13(){ switch __no_tty 13; }; node_14(){
value __user 14; }; node_15(){ value _type_ a; }; node_16(){ value _app_ a; }
node_17(){ value _service_ a; }; node_18(){ value _src_ a; }; node_19(){
value _dst_ a; }; node_20(){ value _backup_file_ a; }; node_21(){
value _args_ a true; }; node_22(){ value _secret_ a; }; node_23(){
value _version_ a; }; node_24(){ value _cmd_ a; }; node_25(){ value _data_ a; }
node_26(){ value _command_ a; }; node_27(){ value _host_ a; }; node_28(){
value _user_ a; }; node_29(){ value _port_ a; }; node_30(){
value _subcommands_ a true; }; node_31(){ _command app; }; node_32(){
_command list; }; node_33(){ _command ls; }; node_34(){ _command new; }
node_35(){ _command backup; }; node_36(){ _command deploy; }; node_37(){
_command check; }; node_38(){ _command config; }; node_39(){ _command cp; }
node_40(){ _command logs; }; node_41(){ _command ps; }; node_42(){
_command restore; }; node_43(){ _command rm; }; node_44(){ _command delete; }
node_45(){ _command run; }; node_46(){ _command secret; }; node_47(){
_command generate; }; node_48(){ _command insert; }; node_49(){
_command undeploy; }; node_50(){ _command server; }; node_51(){ _command add; }
node_52(){ _command init; }; node_53(){ _command apps; }; node_54(){
_command upgrade; }; node_55(){ _command version; }; node_56(){ _command help; }
node_57(){ optional 0 1 2 3 4; }; node_58(){ optional 57; }; node_59(){
either 32 33; }; node_60(){ required 59; }; node_61(){ optional 5; }; node_62(){
optional 6; }; node_63(){ required 58 31 60 61 62; }; node_64(){ optional 7; }
node_65(){ optional 8; }; node_66(){ optional 9; }; node_67(){ optional 10; }
node_68(){ required 58 31 34 62 64 65 66 67 15; }; node_69(){ either 17 11; }
node_70(){ required 69; }; node_71(){ required 58 31 16 35 70; }; node_72(){
required 58 31 16 36; }; node_73(){ required 58 31 16 37; }; node_74(){
required 58 31 16 38; }; node_75(){ required 58 31 16 39 18 19; }; node_76(){
optional 17; }; node_77(){ required 58 31 16 40 76; }; node_78(){
required 58 31 16 41; }; node_79(){ required 58 31 16 42 70; }; node_80(){
either 43 44; }; node_81(){ required 80; }; node_82(){ optional 12; }
node_83(){ required 58 31 16 81 82; }; node_84(){ optional 20; }; node_85(){
required 58 31 16 42 17 84; }; node_86(){ optional 13; }; node_87(){ optional 14
}; node_88(){ oneormore 21; }; node_89(){ required 58 31 16 45 86 87 17 88; }
node_90(){ required 22 23; }; node_91(){ either 90 11; }; node_92(){ required 91
}; node_93(){ optional 24; }; node_94(){ required 58 31 16 46 47 92 93 66; }
node_95(){ required 58 31 16 46 48 22 23 25 66; }; node_96(){ either 22 11; }
node_97(){ required 96; }; node_98(){ required 58 31 16 46 81 97 66 82; }
node_99(){ required 58 31 16 49; }; node_100(){ optional 88; }; node_101(){
required 58 31 16 26 100; }; node_102(){ optional 28; }; node_103(){ optional 29
}; node_104(){ required 58 50 51 27 102 103; }; node_105(){ required 58 50 60; }
node_106(){ required 58 50 27 43; }; node_107(){ required 58 50 27 52; }
node_108(){ required 58 50 27 53 61; }; node_109(){ required 58 54; }
node_110(){ required 58 55; }; node_111(){ oneormore 30; }; node_112(){
optional 111; }; node_113(){ required 58 56 112; }; node_114(){
either 63 68 71 72 73 74 75 77 78 79 83 85 89 94 95 98 99 101 104 105 106 107 108 109 110 113
}; node_115(){ required 114; }; cat <<<' docopt_exit() {
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1320}" >&2
exit 1; }'; unset var___help var___stack var___env var___skip_update \
var___skip_check var___status var___server var___domain var___app_name \
var___pass var___secrets var___all var___force var___no_tty var___user \
var__type_ var__app_ var__service_ var__src_ var__dst_ var__backup_file_ \
var__args_ var__secret_ var__version_ var__cmd_ var__data_ var__command_ \
var__host_ var__user_ var__port_ var__subcommands_ var_app var_list var_ls \
var_new var_backup var_deploy var_check var_config var_cp var_logs var_ps \
var_restore var_rm var_delete var_run var_secret var_generate var_insert \
var_undeploy var_server var_add var_init var_apps var_upgrade var_version \
var_help; parse 115 "$@"; local prefix=${DOCOPT_PREFIX:-''}
unset "${prefix}__help" "${prefix}__stack" "${prefix}__env" \
"${prefix}__skip_update" "${prefix}__skip_check" "${prefix}__status" \
"${prefix}__server" "${prefix}__domain" "${prefix}__app_name" \
"${prefix}__pass" "${prefix}__secrets" "${prefix}__all" "${prefix}__force" \
"${prefix}__no_tty" "${prefix}__user" "${prefix}_type_" "${prefix}_app_" \
"${prefix}_service_" "${prefix}_src_" "${prefix}_dst_" \
"${prefix}_backup_file_" "${prefix}_args_" "${prefix}_secret_" \
"${prefix}_version_" "${prefix}_cmd_" "${prefix}_data_" "${prefix}_command_" \
"${prefix}_host_" "${prefix}_user_" "${prefix}_port_" "${prefix}_subcommands_" \
"${prefix}app" "${prefix}list" "${prefix}ls" "${prefix}new" "${prefix}backup" \
"${prefix}deploy" "${prefix}check" "${prefix}config" "${prefix}cp" \
"${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
"${prefix}delete" "${prefix}run" "${prefix}secret" "${prefix}generate" \
"${prefix}insert" "${prefix}undeploy" "${prefix}server" "${prefix}add" \
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}version" \
"${prefix}help"; eval "${prefix}"'__help=${var___help:-false}'
eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__stack=${var___stack:-}'
eval "${prefix}"'__env=${var___env:-}'
eval "${prefix}"'__skip_update=${var___skip_update:-false}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
eval "${prefix}"'__status=${var___status:-false}'
eval "${prefix}"'__server=${var___server:-}'
eval "${prefix}"'__domain=${var___domain:-}'
eval "${prefix}"'__app_name=${var___app_name:-}'
eval "${prefix}"'__pass=${var___pass:-false}'
eval "${prefix}"'__auto=${var___auto:-false}'
eval "${prefix}"'__status=${var___status:-false}'
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
eval "${prefix}"'__secrets=${var___secrets:-false}'
eval "${prefix}"'__all=${var___all:-false}'
eval "${prefix}"'__force=${var___force:-false}'
eval "${prefix}"'__no_tty=${var___no_tty:-false}'
eval "${prefix}"'__user=${var___user:-}'
eval "${prefix}"'__all=${var___all:-false}'
eval "${prefix}"'_type_=${var__type_:-}'; eval "${prefix}"'_app_=${var__app_:-}'
eval "${prefix}"'_service_=${var__service_:-}'
eval "${prefix}"'_src_=${var__src_:-}'; eval "${prefix}"'_dst_=${var__dst_:-}'
eval "${prefix}"'_backup_file_=${var__backup_file_:-}'
if declare -p var__args_ >/dev/null 2>&1; then
eval "${prefix}"'_args_=("${var__args_[@]}")'; else eval "${prefix}"'_args_=()'
fi; eval "${prefix}"'_secret_=${var__secret_:-}'
@ -247,20 +261,22 @@ eval "${prefix}"'_port_=${var__port_:-}'
if declare -p var__subcommands_ >/dev/null 2>&1; then
eval "${prefix}"'_subcommands_=("${var__subcommands_[@]}")'; else
eval "${prefix}"'_subcommands_=()'; fi; eval "${prefix}"'app=${var_app:-false}'
eval "${prefix}"'new=${var_new:-false}'
eval "${prefix}"'list=${var_list:-false}'; eval "${prefix}"'ls=${var_ls:-false}'
eval "${prefix}"'new=${var_new:-false}'
eval "${prefix}"'backup=${var_backup:-false}'
eval "${prefix}"'deploy=${var_deploy:-false}'
eval "${prefix}"'undeploy=${var_undeploy:-false}'
eval "${prefix}"'config=${var_config:-false}'
eval "${prefix}"'delete=${var_delete:-false}'
eval "${prefix}"'rm=${var_rm:-false}'; eval "${prefix}"'logs=${var_logs:-false}'
eval "${prefix}"'cp=${var_cp:-false}'
eval "${prefix}"'check=${var_check:-false}'
eval "${prefix}"'ps=${var_ps:-false}'; eval "${prefix}"'run=${var_run:-false}'
eval "${prefix}"'config=${var_config:-false}'
eval "${prefix}"'cp=${var_cp:-false}'; eval "${prefix}"'logs=${var_logs:-false}'
eval "${prefix}"'ps=${var_ps:-false}'
eval "${prefix}"'restore=${var_restore:-false}'
eval "${prefix}"'rm=${var_rm:-false}'
eval "${prefix}"'delete=${var_delete:-false}'
eval "${prefix}"'run=${var_run:-false}'
eval "${prefix}"'secret=${var_secret:-false}'
eval "${prefix}"'auto=${var_auto:-false}'
eval "${prefix}"'generate=${var_generate:-false}'
eval "${prefix}"'insert=${var_insert:-false}'
eval "${prefix}"'undeploy=${var_undeploy:-false}'
eval "${prefix}"'server=${var_server:-false}'
eval "${prefix}"'add=${var_add:-false}'
eval "${prefix}"'init=${var_init:-false}'
@ -269,19 +285,20 @@ eval "${prefix}"'upgrade=${var_upgrade:-false}'
eval "${prefix}"'version=${var_version:-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}__help" "${prefix}__env" "${prefix}__stack" \
declare -p "${prefix}__help" "${prefix}__stack" "${prefix}__env" \
"${prefix}__skip_update" "${prefix}__skip_check" "${prefix}__status" \
"${prefix}__server" "${prefix}__domain" "${prefix}__app_name" \
"${prefix}__pass" "${prefix}__auto" "${prefix}__status" \
"${prefix}__skip_check" "${prefix}__force" "${prefix}__no_tty" \
"${prefix}__user" "${prefix}__all" "${prefix}_type_" "${prefix}_app_" \
"${prefix}_service_" "${prefix}_src_" "${prefix}_dst_" "${prefix}_args_" \
"${prefix}_secret_" "${prefix}_version_" "${prefix}_cmd_" "${prefix}_data_" \
"${prefix}_command_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \
"${prefix}_subcommands_" "${prefix}app" "${prefix}new" "${prefix}list" \
"${prefix}ls" "${prefix}deploy" "${prefix}undeploy" "${prefix}config" \
"${prefix}delete" "${prefix}rm" "${prefix}logs" "${prefix}cp" "${prefix}check" \
"${prefix}ps" "${prefix}run" "${prefix}secret" "${prefix}auto" \
"${prefix}generate" "${prefix}insert" "${prefix}server" "${prefix}add" \
"${prefix}__pass" "${prefix}__secrets" "${prefix}__all" "${prefix}__force" \
"${prefix}__no_tty" "${prefix}__user" "${prefix}_type_" "${prefix}_app_" \
"${prefix}_service_" "${prefix}_src_" "${prefix}_dst_" \
"${prefix}_backup_file_" "${prefix}_args_" "${prefix}_secret_" \
"${prefix}_version_" "${prefix}_cmd_" "${prefix}_data_" "${prefix}_command_" \
"${prefix}_host_" "${prefix}_user_" "${prefix}_port_" "${prefix}_subcommands_" \
"${prefix}app" "${prefix}list" "${prefix}ls" "${prefix}new" "${prefix}backup" \
"${prefix}deploy" "${prefix}check" "${prefix}config" "${prefix}cp" \
"${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
"${prefix}delete" "${prefix}run" "${prefix}secret" "${prefix}generate" \
"${prefix}insert" "${prefix}undeploy" "${prefix}server" "${prefix}add" \
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}version" \
"${prefix}help"; done; }
# docopt parser above, complete command for generating this parser is `docopt.sh abra`
@ -349,7 +366,9 @@ require_app_latest() {
success "Fetched app configuration via Git"
fi
cd "$APP_DIR" && git pull > /dev/null 2>&1
if [ "$abra___skip_update" = "false" ]; then
cd "$APP_DIR" && git pull > /dev/null 2>&1
fi
}
# FIXME 3wc: update or remove
@ -387,18 +406,8 @@ get_servers() {
}
get_app_secrets() {
get_app_passwords
get_app_keys
}
get_app_passwords() {
# FIXME 3wc: requires bash 4, use for loop instead
mapfile -t PASSWORDS < <(grep "SECRET.*PASSWORD.*VERSION.*" "$ENV_FILE")
}
get_app_keys() {
# FIXME 3wc: requires bash 4, use for loop instead
mapfile -t KEYS < <(grep "SECRET.*KEY.*VERSION.*" "$ENV_FILE")
mapfile -t PASSWORDS < <(grep "SECRET.*VERSION.*" "$ENV_FILE")
}
load_instance() {
@ -459,7 +468,9 @@ parse_secret() {
# shellcheck disable=SC2001
abra__length_="$(echo "$SECRET" | sed -e 's/.*[^0-9]\([0-9]\+\)[^0-9]*$/\1/')"
else
abra__length_=32
# Note(decentral1se): unset this so that a length value from another secret
# definition does not get passed on to another secret generation flow
unset abra__length_
fi
abra__secret_="${SECRET%_VERSION=*}" # strip _VERSION=v1
@ -468,7 +479,7 @@ parse_secret() {
abra__version_="$(echo "$SECRET" | sed -n 's/.*\(v[0-9]\).*/\1/p')"
if [[ "$SECRET" == *"length"* ]]; then
if [[ -n "$abra__length_" ]]; then
echo "Generating $abra__secret_, version: $abra__version_, length: $abra__length_"
else
echo "Generating $abra__secret_, version: $abra__version_"
@ -493,6 +504,14 @@ stack_logs (){
sleep infinity
}
auto_gen_secrets (){
get_app_secrets
for PASSWORD in "${PASSWORDS[@]}"; do
parse_secret "$PASSWORD"
done
}
#######################################
# abra app ..
#######################################
@ -510,11 +529,14 @@ sub_app_ls (){
help_app_list (){
echo "abra [options] app (list|ls) [--status] [--server=<server>]
List your exciting apps
List your exciting apps.
OPTIONS
--status Show whether apps are deployed (warning! slow!)
--server=<server> Filter to a specific server"
--server=<server> Filter to a specific server
POWERED BY (for --status)
docker stack ls"
}
sub_app_list (){
@ -531,7 +553,7 @@ sub_app_list (){
STATUS="$( [[ $abra___status == "true" ]] && echo "Y" )"
if [ -n "$STATUS" ]; then
if [ -z "$SERVER" ]; then
if [ "$SERVER" = "*" ]; then
get_servers
else
SERVERS=( "$SERVER" )
@ -554,7 +576,7 @@ sub_app_list (){
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\tAPP\tSERVER%s%s\n" "${STATUS:+ }" "${STATUS:+STATUS}"
printf " DOMAIN\tTYPE\tSERVER%s%s\n" "${STATUS:+ }" "${STATUS:+STATUS}"
printf " --\t--\t--%s\n" "${STATUS:+ --}"
fi
@ -568,7 +590,7 @@ sub_app_list (){
set -a
# shellcheck disable=SC1090
APP="$(source "$ENV_FILE" && echo "$APP")"
TYPE="$(source "$ENV_FILE" && echo "$TYPE")"
# shellcheck disable=SC1090
APP_STACK_NAME="$(source "$ENV_FILE" && echo "$STACK_NAME")"
set +a
@ -579,7 +601,7 @@ sub_app_list (){
if [ -n "$STATUS" ]; then
APP_STATUS=$( printf '%s\n' "${DEPLOYED_APPS[@]}" | grep -qP "^${SERVER}~${APP_STACK_NAME}$" && echo "deployed" || echo "inactive")
fi
printf " %s\t%s\t%s%s\n" "$DOMAIN" "$APP" "$SERVER" "${STATUS:+ }${APP_STATUS}"
printf " %s\t%s\t%s%s\n" "$DOMAIN" "$TYPE" "$SERVER" "${STATUS:+ }${APP_STATUS}"
done | column -s' ' -t
# Align table `-t` based on tab characters -s`^V<Tab>`
}
@ -588,7 +610,7 @@ sub_app_list (){
help_app_new (){
echo "abra [options] app new [--server=<server>] [--domain=<domain>] [--pass] [--auto] <type>
Create a new app of <type> (e.g. wordpress or custom-html)
Create a new app of <type> (e.g. wordpress or custom-html).
OPTIONS
--server=<server> Specify which server to use (default: prompt)
@ -658,8 +680,8 @@ sub_app_new (){
get_app_secrets
if [ "${#PASSWORDS[@]}" -gt 0 ] || [ "${#KEYS[@]}" -gt 0 ] && [ "$abra___auto" == "true" ]; then
sub_app_secret_auto
if [ "${#PASSWORDS[@]}" -gt 0 ] && [ "$abra___secrets" == "true" ]; then
auto_gen_secrets
fi
echo "$(tput setaf 4)Your new '$TYPE' is ready for action:$(tput sgr0)"
@ -669,25 +691,59 @@ sub_app_new (){
echo " abra app $APP_NAME deploy$(tput sgr0)"
}
###### .. app <domain> deploy
help_app_deploy (){
echo "abra [options] app <domain> deploy [--skip-check]
Deploy app <domain> to the configured server
OPTIONS
--skip-check Don't check whether app definition is up-to-date first"
}
sub_app_deploy (){
###### .. app backup
sub_app_backup (){
load_instance
load_instance_env
require_app_latest "$TYPE"
if [ "$abra___skip_check" == "false" ]; then
sub_app_check
# Add _<service> if it's defined
FUNCTION="abra_backup${abra__service_:+_}$abra__service_"
if ! type "$FUNCTION" > /dev/null 2>&1; then
error "'$TYPE' doesn't know how to do ${abra__service_}${abra__service_:+ }backups."\
"See $GIT_URL$TYPE/issues/"
fi
mkdir -p "$ABRA_DIR/backups"
$FUNCTION
}
###### .. app restore
sub_app_restore (){
load_instance
load_instance_env
require_app_latest "$TYPE"
FUNCTION="abra_restore_$abra__service_"
if ! type "$FUNCTION" > /dev/null 2>&1; then
error "'$TYPE' doesn't know how to restore '${abra__service_}' backups."\
"See $GIT_URL$TYPE/issues/"
fi
$FUNCTION "$abra__backup_file_"
}
###### .. app deploy
help_app_deploy (){
echo "abra [options] app <domain> deploy [--skip-check]
Deploy app <domain> to the configured server.
POWERED BY
docker stack deploy -c compose.yml <app>"
}
sub_app_deploy (){
load_instance
load_instance_env
require_app_latest "$TYPE"
echo "About to deploy:"
echo " Server: $(tput setaf 4)${SERVER}$(tput sgr0)"
if [ "${COMPOSE_FILE/:/}" == "${COMPOSE_FILE}" ]; then
@ -725,6 +781,15 @@ sub_app_deploy (){
}
###### .. app <domain> undeploy
help_app_undeploy (){
echo "abra [options] app <app> undeploy
Opposite of \`app <app> deploy\`; deactivate an app without deleting anything.
POWERED BY
docker stack rm <app>"
}
sub_app_undeploy (){
load_instance
load_instance_env
@ -735,7 +800,13 @@ sub_app_undeploy (){
docker stack rm "$STACK_NAME"
}
###### .. app <domain> config
###### .. app config
help_app_config (){
echo "abra [options] app <app> config
Open the app configuration in \$EDITOR."
}
sub_app_config (){
load_instance
@ -768,13 +839,21 @@ sub_app_config (){
}
###### .. app check
help_app_check (){
echo "abra [options] app <app> check
Make sure that all an app's required variables are set."
}
sub_app_check (){
if [ "$abra___skip_check" = "true" ]; then
return 0
fi
load_instance
load_instance_env
#APP_ENV=$(grep -v '^#' "$ENV_FILE" | sed 's/^.* \([^=]\+\)=.*/\1/' | sort)
APP_ENV=$(grep -v '^#' "$ENV_FILE" | cut -d' ' -f2 | cut -d'=' -f1 | sort)
#STACK_ENV=$(grep -v '^#' "$APP_DIR/.env.sample" | sed 's/^.* \([^=]\+\)=.*/\1/' | sort)
STACK_ENV=$(grep -v '^#' "$APP_DIR/.env.sample" | cut -d' ' -f2 | cut -d'=' -f1 | sort)
# Only show "1", items in STACK_ENV which aren't in APP_ENV
@ -789,6 +868,15 @@ sub_app_check (){
}
###### .. app ps
help_app_ps (){
echo "abra [options] app <app> ps
Show <app>'s running containers.
POWERED BY
docker stack ps <app>"
}
sub_app_ps (){
load_instance
load_instance_env
@ -796,11 +884,24 @@ sub_app_ps (){
docker stack ps "$STACK_NAME"
}
###### .. app <domain> delete
###### .. app delete
help_app_rm (){
help_app_delete
}
sub_app_rm (){
sub_app_delete
}
help_app_delete (){
echo "abra [options] app <app> (rm|delete) [--force]
Delete local configuration for <app>.
OPTIONS
--force Live dangerously; skip prompt for confirmation"
}
sub_app_delete (){
load_instance
load_instance_env
@ -813,7 +914,15 @@ sub_app_delete (){
rm "$ENV_FILE"
}
###### .. app <domain> secret insert
###### .. app secret insert
help_app_secret_insert (){
echo "abra [options] app <app> secret insert <secret> <version> <data> [--pass]
Store <data> as a Docker secret called <secret>_<version>.
OPTIONS
--pass Save the secret in \`pass\` as well"
}
sub_app_secret_insert() {
load_instance
load_instance_env
@ -836,12 +945,27 @@ sub_app_secret_insert() {
fi
}
###### .. app <domain> secret delete
sub_app_secret_delete(){
sub_app_secret_rm
###### .. app secret delete
help_app_secret_rm (){
help_app_secret_delete
}
sub_app_secret_rm(){
sub_app_secret_delete
}
help_app_secret_delete (){
echo "abra [options] app <app> secret (delete|rm) (<secret>|--all) [--pass] [--force]
Remove <app>'s Docker secret <secret>.
OPTIONS
--pass Remove secret(s) from \`pass\` as well
--all Delete all secrets for <app>
--force Live dangerously; skip prompt for confirmation"
}
sub_app_secret_delete(){
load_instance
load_instance_env
@ -870,7 +994,17 @@ sub_app_secret_rm(){
done
}
###### .. app <domain> secret generate
###### .. app secret generate
help_app_secret_generate (){
echo "abra [options] app <app> secret generate <secret> <version> [<cmd>] [--pass]
Generate <secret>_<version> for <app> and store as a Docker secret.
OPTIONS
<cmd> Run <cmd> to generate secret (default: pwqgen)
--pass Save generated secrets in \`pass\`"
}
sub_app_secret_generate(){
load_instance
load_instance_env
@ -879,15 +1013,23 @@ sub_app_secret_generate(){
VERSION="$abra__version_"
LENGTH="$abra__length_"
if [[ "$SECRET" == *"password"* ]]; then
require_pwqgen
PWGEN="${abra__cmd_:-pwqgen}"
else
require_pwgen
PWGEN=${abra__cmd_:-pwgen -s "$LENGTH" 1}
if [ "$abra___all" == "true" ]; then
# Note(decentral1se): we need to reset the flag here to avoid the infinite
# recursion of auto_gen_secrets which calls this function itself
abra___all="false"
auto_gen_secrets
fi
if [ -z "$SECRET" ] || [ -z "$VERSION" ]; then
if [[ -n "$LENGTH" ]]; then
require_pwgen
PWGEN=${abra__cmd_:-pwgen -s "$LENGTH" 1}
else
require_pwqgen
PWGEN="${abra__cmd_:-pwqgen}"
fi
if [ -z "$SECRET" ] || [ -z "$VERSION" ] && [ "$abra___all" == "false" ]; then
error "Required arguments missing"
fi
@ -902,22 +1044,26 @@ sub_app_secret_generate(){
sub_app_secret_insert
}
sub_app_secret_auto(){
load_instance
load_instance_env
###### .. app run
help_app_run (){
echo "abra [options] app <app> run [--no-tty] [--user=<user>] <service> <args>...
get_app_secrets
Run <args>... (often something like 'bash' or 'sh') in <app>'s <service>
container.
for PASSWORD in "${PASSWORDS[@]}"; do
parse_secret "$PASSWORD"
done
OPTIONS
--no-tty Don't allocate a TTY; sometimes running \`mysql\` enjoys this
--user=<user> Run as the UNIX user <user>, e.g. for running Wordpress-CLI
as www-data
for KEY in "${KEYS[@]}"; do
parse_secret "$KEY"
done
EXAMPLES
abra wordpress_foo_bar run app bash
POWERED BY
CONTAINER_ID=\$(docker container ls -f ...)
docker exec \$CONTAINER_ID ..."
}
###### .. app <domain> run <args>...
sub_app_run(){
load_instance
load_instance_env
@ -948,7 +1094,23 @@ sub_app_run(){
return
}
###### .. app <domain> logs <service> <args>...
###### .. app logs
help_app_logs (){
echo "abra [options] app <app> logs [<service>]
Show logs for <app>.
OPTIONS
<service> Only show logs for a specific service (default: combine all
services)
EXAMPLES
abra wordpress_foo_bar logs app
POWERED BY
docker service logs"
}
sub_app_logs (){
load_instance
load_instance_env
@ -978,7 +1140,29 @@ sub_app_logs (){
docker service logs "${STACK_NAME}_${SERVICE}" $LOGS_ARGS
}
###### .. app <domain> cp <src> <dst>
###### .. app cp
help_app_cp (){
echo "abra [options] app <app> cp <src> <dst>
Copy files to or from a running container.
One of <src> or <dst> must have the format <service>:<path>.
Copying multiple files is possible using \`tar\`, see EXAMPLES.
If <dst> is a file then it will be over-written, if it is a folder then <src>
will be copied into it.
EXAMPLES
abra customhtml_foo_bar_com cp index.html app:/usr/share/nginx/html/
tar cf - wp-content | abra wordpress_bar_bat_com cp - app:/var/www/html/
POWERED BY
CONTAINER_ID=\$(docker container ls -f ...)
docker cp \$CONTAINER_ID:<src> <dst>
docker cp \$CONTAINER_ID:<dst> <src>"
}
sub_app_cp() {
load_instance
load_instance_env
@ -1018,10 +1202,20 @@ sub_app_cp() {
#######################################
###### .. server ls
help_server_ls (){
help_server_list
}
sub_server_ls() {
sub_server_list
}
help_server_list (){
echo "abra [options] server (list|ls)
List locally-defined servers."
}
sub_server_list() {
get_servers
printf "%s servers:\n\n" "${#SERVERS[@]}"
@ -1030,7 +1224,17 @@ sub_server_list() {
done
}
###### .. server init <host>
###### .. server init
help_server_init (){
echo "abra [options] server init
Set up a server for Docker swarm joy.
POWERED BY
docker swarm init
docker network create ..."
}
sub_server_init() {
export DOCKER_CONTEXT="${abra__host_}"
@ -1040,7 +1244,19 @@ sub_server_init() {
docker network create --driver=overlay proxy --scope swarm || true
}
###### .. server <add> <host> [<username>] [<password>]
###### .. server add
help_server_add (){
echo "abra [options] server add <host> [<user>] [<port>]
Add a server, reachable on <host>.
OPTIONS
<user>, <port> SSH connection details
POWERED BY
docker context create ..."
}
sub_server_add() {
require_abra_dir
@ -1064,14 +1280,40 @@ sub_server_add() {
}
###### .. server <host> delete
help_server_rm (){
help_server_delete
}
sub_server_rm() {
sub_server_delete
}
help_server_delete (){
echo "abra [options] server <host> delete
Remove server <host>
POWERED BY
docker context rm ..."
}
sub_server_delete() {
docker context rm "$abra__host_"
}
###### .. server <host> apps
help_server_apps (){
echo "abra [options] server <host> apps [--status]
Alias for \`abra app ls --server=<host>.
OPTIONS
--status Show whether apps are deployed (warning! slow!)
POWERED BY (for --status)
docker stack ls"
}
sub_server_apps() {
abra___server="$abra__host_"
sub_app_list
@ -1082,16 +1324,32 @@ sub_server_apps() {
#######################################
###### .. upgrade
help_upgrade (){
echo "abra [options] upgrade
Upgrade abra itself, using the online installer script."
}
sub_upgrade() {
curl https://install.abra.autonomic.zone | bash
}
###### .. version
help_version (){
echo "abra [options] version
Show the installed version of abra (currently $ABRA_VERSION)."
}
sub_version() {
echo "$ABRA_VERSION"
}
###### .. help
help_help (){
echo "HEEEEEELP! 😱"
}
sub_help() {
SUBCOMMAND=$(IFS="_"; echo "${abra__subcommands_[*]}")
if [ -z "$SUBCOMMAND" ]; then
@ -1143,8 +1401,9 @@ abra() {
abra__secret_ abra__version_ abra__data_ abra___user abra__host_ \
abra__type_ abra__port_ abra__user_ abra__service_ abra__src_ abra__dst_ \
abra___server abra___domain abra___force abra___pass \
abra___auto abra___status abra___no_tty abra___skip_check \
abra__subcommands_ abra___app_name
abra___secrets abra___status abra___no_tty abra___app_name \
abra__subcommands_ abra___skip_update abra___skip_check \
abra__backup_file_
if ! type tput > /dev/null 2>&1; then
tput() {

View File

@ -5,7 +5,7 @@ ABRA_SRC="https://git.autonomic.zone/coop-cloud/abra/raw/tag/$ABRA_VERSION/abra"
function install_abra {
mkdir -p "$HOME/.local/bin"
curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
chmod +x "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.loca/bin/abra"
}