First foray into <domain> → <app>
This commit is contained in:
parent
b9e97688d6
commit
8384af8b95
55
abra
55
abra
@ -13,20 +13,20 @@ The cooperative cloud utility belt 🎩🐇
|
||||
Usage:
|
||||
abra [options] app new [--server=<server>] [--domain=<domain>] [--pass] [--auto] <type>
|
||||
abra [options] app (list|ls) [--status] [--server=<server>]
|
||||
abra [options] app <domain> deploy [--skip-check]
|
||||
abra [options] app <domain> undeploy
|
||||
abra [options] app <domain> config
|
||||
abra [options] app <domain> (delete|rm) [--force]
|
||||
abra [options] app <domain> logs [<service>]
|
||||
abra [options] app <domain> cp <src> <dst>
|
||||
abra [options] app <domain> check
|
||||
abra [options] app <domain> ps
|
||||
abra [options] app <domain> run [--no-tty] [--user=<user>] <service> <args>...
|
||||
abra [options] app <domain> secret auto [--pass]
|
||||
abra [options] app <domain> secret generate <secret> <version> [<cmd>] [--pass]
|
||||
abra [options] app <domain> secret insert <secret> <version> <data> [--pass]
|
||||
abra [options] app <domain> secret (delete|rm) (<secret>|--all) [--pass] [--force]
|
||||
abra [options] app <domain> <command> [<args>...]
|
||||
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 <app> check
|
||||
abra [options] app <app> ps
|
||||
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 insert <secret> <version> <data> [--pass]
|
||||
abra [options] app <app> secret (delete|rm) (<secret>|--all) [--pass] [--force]
|
||||
abra [options] app <app> <command> [<args>...]
|
||||
abra [options] server add <host> [<user>] [<port>]
|
||||
abra [options] server (list|ls)
|
||||
abra [options] server <host> rm
|
||||
@ -142,8 +142,8 @@ 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:1466}
|
||||
usage=${DOC:40:1158}; digest=f9a9a
|
||||
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:1424}
|
||||
usage=${DOC:40:1116}; digest=479f2
|
||||
shorts=(-e -h -s -v '' '' '' '' '' '' '' '' '' '')
|
||||
longs=(--env --help --stack --version --server --domain --pass --auto --status --skip-check --force --no-tty --user --all)
|
||||
argcounts=(1 0 1 0 1 1 0 0 0 0 0 0 1 0); node_0(){ value __env 0; }; node_1(){
|
||||
@ -152,7 +152,7 @@ switch __help 1; }; node_2(){ value __stack 2; }; node_3(){ switch __version 3
|
||||
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 _domain_ a; }; node_16(){
|
||||
}; 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; }
|
||||
@ -190,11 +190,11 @@ required 52 46 25 48; }; node_94(){ required 52 46 25 49 60; }; node_95(){
|
||||
required 52 50; }; node_96(){
|
||||
either 57 61 63 64 65 69 71 72 73 74 78 79 81 82 85 87 90 91 92 93 94 95; }
|
||||
node_97(){ required 96; }; cat <<<' docopt_exit() {
|
||||
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1158}" >&2
|
||||
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1116}" >&2
|
||||
exit 1; }'; unset var___env var___help var___stack var___version var___server \
|
||||
var___domain var___pass var___auto var___status var___skip_check var___force \
|
||||
var___no_tty var___user var___all var__type_ var__domain_ var__service_ \
|
||||
var__src_ var__dst_ var__args_ var__secret_ var__version_ var__cmd_ var__data_ \
|
||||
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_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 \
|
||||
@ -203,7 +203,7 @@ unset "${prefix}__env" "${prefix}__help" "${prefix}__stack" \
|
||||
"${prefix}__version" "${prefix}__server" "${prefix}__domain" "${prefix}__pass" \
|
||||
"${prefix}__auto" "${prefix}__status" "${prefix}__skip_check" \
|
||||
"${prefix}__force" "${prefix}__no_tty" "${prefix}__user" "${prefix}__all" \
|
||||
"${prefix}_type_" "${prefix}_domain_" "${prefix}_service_" "${prefix}_src_" \
|
||||
"${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}app" "${prefix}new" \
|
||||
@ -226,8 +226,7 @@ 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}"'_domain_=${var__domain_:-}'
|
||||
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_:-}'
|
||||
if declare -p var__args_ >/dev/null 2>&1; then
|
||||
@ -263,7 +262,7 @@ declare -p "${prefix}__env" "${prefix}__help" "${prefix}__stack" \
|
||||
"${prefix}__version" "${prefix}__server" "${prefix}__domain" "${prefix}__pass" \
|
||||
"${prefix}__auto" "${prefix}__status" "${prefix}__skip_check" \
|
||||
"${prefix}__force" "${prefix}__no_tty" "${prefix}__user" "${prefix}__all" \
|
||||
"${prefix}_type_" "${prefix}_domain_" "${prefix}_service_" "${prefix}_src_" \
|
||||
"${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}app" "${prefix}new" \
|
||||
@ -347,7 +346,7 @@ load_custom_commands() {
|
||||
source abra-commands.sh
|
||||
fi
|
||||
|
||||
if [ -n "$abra__domain_" ]; then
|
||||
if [ -n "$abra__app_" ]; then
|
||||
load_instance
|
||||
load_instance_env
|
||||
require_app_latest "$APP"
|
||||
@ -384,7 +383,7 @@ get_app_keys() {
|
||||
}
|
||||
|
||||
load_instance() {
|
||||
DOMAIN="$abra__domain_"
|
||||
DOMAIN="$abra__app_"
|
||||
# FIXME 3wc: requires bash 4, use for loop instead
|
||||
mapfile -t ENV_FILES < <(find -L "$ABRA_DIR" -name "$DOMAIN.env")
|
||||
case "${#ENV_FILES[@]}" in
|
||||
@ -595,7 +594,7 @@ sub_app_new (){
|
||||
sed -i "s/$APP\.example\.com/$DOMAIN/g" "$ENV_FILE"
|
||||
sed -i "s/example\.com/$DOMAIN/g" "$ENV_FILE"
|
||||
|
||||
abra__domain_="$DOMAIN"
|
||||
abra__app_="$DOMAIN"
|
||||
|
||||
get_app_secrets
|
||||
|
||||
@ -1020,7 +1019,7 @@ abra() {
|
||||
declare abra___stack abra___env abra__command_ abra__args_ \
|
||||
abra__secret_ abra__version_ abra__data_ abra___user abra__host_ \
|
||||
abra__type_ abra__port_ abra__user_ abra__service_ abra__src_ abra__dst_ \
|
||||
abra__domain_ abra___server abra___domain abra___force abra___pass \
|
||||
abra__app_ abra___server abra___domain abra___force abra___pass \
|
||||
abra___auto abra___status abra___no_tty abra___skip_check
|
||||
|
||||
if ! type tput > /dev/null 2>&1; then
|
||||
|
Loading…
Reference in New Issue
Block a user