parent
33280f90b3
commit
e2640fac08
316
abra
316
abra
@ -36,6 +36,7 @@ Usage:
|
|||||||
abra [options] app <app> undeploy
|
abra [options] app <app> undeploy
|
||||||
abra [options] app <app> <command> [<args>...]
|
abra [options] app <app> <command> [<args>...]
|
||||||
abra [options] recipe ls
|
abra [options] recipe ls
|
||||||
|
abra [options] recipe <recipe> release
|
||||||
abra [options] recipe <recipe> versions
|
abra [options] recipe <recipe> versions
|
||||||
abra [options] server add <host> [<user>] [<port>]
|
abra [options] server add <host> [<user>] [<port>]
|
||||||
abra [options] server new <provider>
|
abra [options] server new <provider>
|
||||||
@ -162,29 +163,30 @@ 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() {
|
return 1; }; stdout() { printf -- "cat <<'EOM'\n%s\nEOM\n" "$1"; }; stderr() {
|
||||||
printf -- "cat <<'EOM' >&2\n%s\nEOM\n" "$1"; }; error() {
|
printf -- "cat <<'EOM' >&2\n%s\nEOM\n" "$1"; }; error() {
|
||||||
[[ -n $1 ]] && stderr "$1"; stderr "$usage"; _return 1; }; _return() {
|
[[ -n $1 ]] && stderr "$1"; stderr "$usage"; _return 1; }; _return() {
|
||||||
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2245}
|
printf -- "exit %d\n" "$1"; exit "$1"; }; set -e; trimmed_doc=${DOC:1:2286}
|
||||||
usage=${DOC:40:1636}; digest=ba0b1
|
usage=${DOC:40:1677}; digest=07a57
|
||||||
shorts=(-C -d -s -h -v -U -e -b -n '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
|
shorts=(-h -s -U -e -b -v -C -d -n '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
|
||||||
longs=(--skip-check --debug --stack --help --verbose --skip-update --env --branch --no-prompt --status --server --type --domain --app-name --pass --secrets --all --update --force --skip-version-check --volumes --no-tty --user --dev)
|
longs=(--help --stack --skip-update --env --branch --verbose --skip-check --debug --no-prompt --status --server --type --domain --app-name --pass --secrets --all --update --force --skip-version-check --volumes --no-tty --user --dev)
|
||||||
argcounts=(0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0); node_0(){
|
argcounts=(0 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0); node_0(){
|
||||||
switch __skip_check 0; }; node_1(){ switch __debug 1; }; node_2(){
|
switch __help 0; }; node_1(){ value __stack 1; }; node_2(){
|
||||||
value __stack 2; }; node_3(){ switch __help 3; }; node_4(){ switch __verbose 4
|
switch __skip_update 2; }; node_3(){ value __env 3; }; node_4(){
|
||||||
}; node_5(){ switch __skip_update 5; }; node_6(){ value __env 6; }; node_7(){
|
value __branch 4; }; node_5(){ switch __verbose 5; }; node_6(){
|
||||||
value __branch 7; }; node_8(){ switch __no_prompt 8; }; node_9(){
|
switch __skip_check 6; }; node_7(){ switch __debug 7; }; node_8(){
|
||||||
switch __status 9; }; node_10(){ value __server 10; }; node_11(){
|
switch __no_prompt 8; }; node_9(){ switch __status 9; }; node_10(){
|
||||||
value __type 11; }; node_12(){ value __domain 12; }; node_13(){
|
value __server 10; }; node_11(){ value __type 11; }; node_12(){
|
||||||
value __app_name 13; }; node_14(){ switch __pass 14; }; node_15(){
|
value __domain 12; }; node_13(){ value __app_name 13; }; node_14(){
|
||||||
switch __secrets 15; }; node_16(){ switch __all 16; }; node_17(){
|
switch __pass 14; }; node_15(){ switch __secrets 15; }; node_16(){
|
||||||
switch __update 17; }; node_18(){ switch __force 18; }; node_19(){
|
switch __all 16; }; node_17(){ switch __update 17; }; node_18(){
|
||||||
switch __skip_version_check 19; }; node_20(){ switch __volumes 20; }; node_21(){
|
switch __force 18; }; node_19(){ switch __skip_version_check 19; }; node_20(){
|
||||||
switch __no_tty 21; }; node_22(){ value __user 22; }; node_23(){ switch __dev 23
|
switch __volumes 20; }; node_21(){ switch __no_tty 21; }; node_22(){
|
||||||
}; node_24(){ value _type_ a; }; node_25(){ value _app_ a; }; node_26(){
|
value __user 22; }; node_23(){ switch __dev 23; }; node_24(){ value _type_ a; }
|
||||||
value _service_ a; }; node_27(){ value _version_ a; }; node_28(){ value _src_ a
|
node_25(){ value _app_ a; }; node_26(){ value _service_ a; }; node_27(){
|
||||||
}; node_29(){ value _dst_ a; }; node_30(){ value _backup_file_ a; }; node_31(){
|
value _version_ a; }; node_28(){ value _src_ a; }; node_29(){ value _dst_ a; }
|
||||||
value _args_ a true; }; node_32(){ value _secret_ a; }; node_33(){ value _cmd_ a
|
node_30(){ value _backup_file_ a; }; node_31(){ value _args_ a true; }
|
||||||
}; node_34(){ value _data_ a; }; node_35(){ value _command_ a; }; node_36(){
|
node_32(){ value _secret_ a; }; node_33(){ value _cmd_ a; }; node_34(){
|
||||||
value _recipe_ a; }; node_37(){ value _host_ a; }; node_38(){ value _user_ a; }
|
value _data_ a; }; node_35(){ value _command_ a; }; node_36(){ value _recipe_ a
|
||||||
node_39(){ value _port_ a; }; node_40(){ value _provider_ a; }; node_41(){
|
}; node_37(){ value _host_ a; }; node_38(){ value _user_ a; }; node_39(){
|
||||||
|
value _port_ a; }; node_40(){ value _provider_ a; }; node_41(){
|
||||||
value _subcommands_ a true; }; node_42(){ _command app; }; node_43(){
|
value _subcommands_ a true; }; node_42(){ _command app; }; node_43(){
|
||||||
_command list; }; node_44(){ _command ls; }; node_45(){ _command new; }
|
_command list; }; node_44(){ _command ls; }; node_45(){ _command new; }
|
||||||
node_46(){ _command backup; }; node_47(){ _command deploy; }; node_48(){
|
node_46(){ _command backup; }; node_47(){ _command deploy; }; node_48(){
|
||||||
@ -194,47 +196,49 @@ node_51(){ _command cp; }; node_52(){ _command logs; }; node_53(){ _command ps
|
|||||||
_command delete; }; node_57(){ _command run; }; node_58(){ _command rollback; }
|
_command delete; }; node_57(){ _command run; }; node_58(){ _command rollback; }
|
||||||
node_59(){ _command secret; }; node_60(){ _command generate; }; node_61(){
|
node_59(){ _command secret; }; node_60(){ _command generate; }; node_61(){
|
||||||
_command insert; }; node_62(){ _command undeploy; }; node_63(){ _command recipe
|
_command insert; }; node_62(){ _command undeploy; }; node_63(){ _command recipe
|
||||||
}; node_64(){ _command versions; }; node_65(){ _command server; }; node_66(){
|
}; node_64(){ _command release; }; node_65(){ _command versions; }; node_66(){
|
||||||
_command add; }; node_67(){ _command init; }; node_68(){ _command apps; }
|
_command server; }; node_67(){ _command add; }; node_68(){ _command init; }
|
||||||
node_69(){ _command upgrade; }; node_70(){ _command doctor; }; node_71(){
|
node_69(){ _command apps; }; node_70(){ _command upgrade; }; node_71(){
|
||||||
_command help; }; node_72(){ optional 0 1 2 3 4 5 6 7 8; }; node_73(){
|
_command doctor; }; node_72(){ _command help; }; node_73(){
|
||||||
optional 72; }; node_74(){ either 43 44; }; node_75(){ required 74; }
|
optional 0 1 2 3 4 5 6 7 8; }; node_74(){ optional 73; }; node_75(){
|
||||||
node_76(){ optional 9; }; node_77(){ optional 10; }; node_78(){ optional 11; }
|
either 43 44; }; node_76(){ required 75; }; node_77(){ optional 9; }; node_78(){
|
||||||
node_79(){ required 73 42 75 76 77 78; }; node_80(){ optional 12; }; node_81(){
|
optional 10; }; node_79(){ optional 11; }; node_80(){ required 74 42 76 77 78 79
|
||||||
optional 13; }; node_82(){ optional 14; }; node_83(){ optional 15; }; node_84(){
|
}; node_81(){ optional 12; }; node_82(){ optional 13; }; node_83(){ optional 14
|
||||||
required 73 42 45 77 80 81 82 83 24; }; node_85(){ either 26 16; }; node_86(){
|
}; node_84(){ optional 15; }; node_85(){ required 74 42 45 78 81 82 83 84 24; }
|
||||||
required 85; }; node_87(){ required 73 42 25 46 86; }; node_88(){ optional 17; }
|
node_86(){ either 26 16; }; node_87(){ required 86; }; node_88(){
|
||||||
node_89(){ optional 18; }; node_90(){ optional 19; }; node_91(){ optional 27; }
|
required 74 42 25 46 87; }; node_89(){ optional 17; }; node_90(){ optional 18; }
|
||||||
node_92(){ required 73 42 25 47 88 89 90 91; }; node_93(){ required 73 42 25 48
|
node_91(){ optional 19; }; node_92(){ optional 27; }; node_93(){
|
||||||
}; node_94(){ required 73 42 25 49; }; node_95(){ required 73 42 25 50; }
|
required 74 42 25 47 89 90 91 92; }; node_94(){ required 74 42 25 48; }
|
||||||
node_96(){ required 73 42 25 51 28 29; }; node_97(){ optional 26; }; node_98(){
|
node_95(){ required 74 42 25 49; }; node_96(){ required 74 42 25 50; }
|
||||||
required 73 42 25 52 97; }; node_99(){ required 73 42 25 53; }; node_100(){
|
node_97(){ required 74 42 25 51 28 29; }; node_98(){ optional 26; }; node_99(){
|
||||||
required 73 42 25 54 86; }; node_101(){ either 55 56; }; node_102(){
|
required 74 42 25 52 98; }; node_100(){ required 74 42 25 53; }; node_101(){
|
||||||
required 101; }; node_103(){ optional 20; }; node_104(){
|
required 74 42 25 54 87; }; node_102(){ either 55 56; }; node_103(){
|
||||||
required 73 42 25 102 103 83; }; node_105(){ optional 30; }; node_106(){
|
required 102; }; node_104(){ optional 20; }; node_105(){
|
||||||
required 73 42 25 54 26 105; }; node_107(){ optional 21; }; node_108(){
|
required 74 42 25 103 104 84; }; node_106(){ optional 30; }; node_107(){
|
||||||
optional 22; }; node_109(){ oneormore 31; }; node_110(){
|
required 74 42 25 54 26 106; }; node_108(){ optional 21; }; node_109(){
|
||||||
required 73 42 25 57 107 108 26 109; }; node_111(){ required 73 42 25 58 91; }
|
optional 22; }; node_110(){ oneormore 31; }; node_111(){
|
||||||
node_112(){ required 32 27; }; node_113(){ either 112 16; }; node_114(){
|
required 74 42 25 57 108 109 26 110; }; node_112(){ required 74 42 25 58 92; }
|
||||||
required 113; }; node_115(){ optional 33; }; node_116(){
|
node_113(){ required 32 27; }; node_114(){ either 113 16; }; node_115(){
|
||||||
required 73 42 25 59 60 114 115 82; }; node_117(){
|
required 114; }; node_116(){ optional 33; }; node_117(){
|
||||||
required 73 42 25 59 61 32 27 34 82; }; node_118(){ either 32 16; }; node_119(){
|
required 74 42 25 59 60 115 116 83; }; node_118(){
|
||||||
required 118; }; node_120(){ required 73 42 25 59 102 119 82; }; node_121(){
|
required 74 42 25 59 61 32 27 34 83; }; node_119(){ either 32 16; }; node_120(){
|
||||||
required 73 42 25 62; }; node_122(){ optional 109; }; node_123(){
|
required 119; }; node_121(){ required 74 42 25 59 103 120 83; }; node_122(){
|
||||||
required 73 42 25 35 122; }; node_124(){ required 73 63 44; }; node_125(){
|
required 74 42 25 62; }; node_123(){ optional 110; }; node_124(){
|
||||||
required 73 63 36 64; }; node_126(){ optional 38; }; node_127(){ optional 39; }
|
required 74 42 25 35 123; }; node_125(){ required 74 63 44; }; node_126(){
|
||||||
node_128(){ required 73 65 66 37 126 127; }; node_129(){ required 73 65 45 40; }
|
required 74 63 36 64; }; node_127(){ required 74 63 36 65; }; node_128(){
|
||||||
node_130(){ required 73 65 75; }; node_131(){ required 73 65 37 55; }
|
optional 38; }; node_129(){ optional 39; }; node_130(){
|
||||||
node_132(){ required 73 65 37 67; }; node_133(){ required 73 65 37 68 76; }
|
required 74 66 67 37 128 129; }; node_131(){ required 74 66 45 40; }
|
||||||
node_134(){ optional 23; }; node_135(){ required 73 69 134; }; node_136(){
|
node_132(){ required 74 66 76; }; node_133(){ required 74 66 37 55; }
|
||||||
required 73 49; }; node_137(){ required 73 70; }; node_138(){ oneormore 41; }
|
node_134(){ required 74 66 37 68; }; node_135(){ required 74 66 37 69 77; }
|
||||||
node_139(){ optional 138; }; node_140(){ required 73 71 139; }; node_141(){
|
node_136(){ optional 23; }; node_137(){ required 74 70 136; }; node_138(){
|
||||||
required 73; }; node_142(){
|
required 74 49; }; node_139(){ required 74 71; }; node_140(){ oneormore 41; }
|
||||||
either 79 84 87 92 93 94 95 96 98 99 100 104 106 110 111 116 117 120 121 123 124 125 128 129 130 131 132 133 135 136 137 140 141
|
node_141(){ optional 140; }; node_142(){ required 74 72 141; }; node_143(){
|
||||||
}; node_143(){ required 142; }; cat <<<' docopt_exit() {
|
required 74; }; node_144(){
|
||||||
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1636}" >&2
|
either 80 85 88 93 94 95 96 97 99 100 101 105 107 111 112 117 118 121 122 124 125 126 127 130 131 132 133 134 135 137 138 139 142 143
|
||||||
exit 1; }'; unset var___skip_check var___debug var___stack var___help \
|
}; node_145(){ required 144; }; cat <<<' docopt_exit() {
|
||||||
var___verbose var___skip_update var___env var___branch var___no_prompt \
|
[[ -n $1 ]] && printf "%s\n" "$1" >&2; printf "%s\n" "${DOC:40:1677}" >&2
|
||||||
|
exit 1; }'; unset var___help var___stack var___skip_update var___env \
|
||||||
|
var___branch var___verbose var___skip_check var___debug var___no_prompt \
|
||||||
var___status var___server var___type var___domain var___app_name var___pass \
|
var___status var___server var___type var___domain var___app_name var___pass \
|
||||||
var___secrets var___all var___update var___force var___skip_version_check \
|
var___secrets var___all var___update var___force var___skip_version_check \
|
||||||
var___volumes var___no_tty var___user var___dev var__type_ var__app_ \
|
var___volumes var___no_tty var___user var___dev var__type_ var__app_ \
|
||||||
@ -243,36 +247,36 @@ var__secret_ var__cmd_ var__data_ var__command_ var__recipe_ var__host_ \
|
|||||||
var__user_ var__port_ var__provider_ var__subcommands_ var_app var_list var_ls \
|
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_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_secret \
|
var_ps var_restore var_rm var_delete var_run var_rollback var_secret \
|
||||||
var_generate var_insert var_undeploy var_recipe var_versions var_server \
|
var_generate var_insert var_undeploy var_recipe var_release var_versions \
|
||||||
var_add var_init var_apps var_upgrade var_doctor var_help; parse 143 "$@"
|
var_server var_add var_init var_apps var_upgrade var_doctor var_help
|
||||||
local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__skip_check" \
|
parse 145 "$@"; local prefix=${DOCOPT_PREFIX:-''}; unset "${prefix}__help" \
|
||||||
"${prefix}__debug" "${prefix}__stack" "${prefix}__help" "${prefix}__verbose" \
|
"${prefix}__stack" "${prefix}__skip_update" "${prefix}__env" \
|
||||||
"${prefix}__skip_update" "${prefix}__env" "${prefix}__branch" \
|
"${prefix}__branch" "${prefix}__verbose" "${prefix}__skip_check" \
|
||||||
"${prefix}__no_prompt" "${prefix}__status" "${prefix}__server" \
|
"${prefix}__debug" "${prefix}__no_prompt" "${prefix}__status" \
|
||||||
"${prefix}__type" "${prefix}__domain" "${prefix}__app_name" "${prefix}__pass" \
|
"${prefix}__server" "${prefix}__type" "${prefix}__domain" \
|
||||||
"${prefix}__secrets" "${prefix}__all" "${prefix}__update" "${prefix}__force" \
|
"${prefix}__app_name" "${prefix}__pass" "${prefix}__secrets" "${prefix}__all" \
|
||||||
"${prefix}__skip_version_check" "${prefix}__volumes" "${prefix}__no_tty" \
|
"${prefix}__update" "${prefix}__force" "${prefix}__skip_version_check" \
|
||||||
"${prefix}__user" "${prefix}__dev" "${prefix}_type_" "${prefix}_app_" \
|
"${prefix}__volumes" "${prefix}__no_tty" "${prefix}__user" "${prefix}__dev" \
|
||||||
"${prefix}_service_" "${prefix}_version_" "${prefix}_src_" "${prefix}_dst_" \
|
"${prefix}_type_" "${prefix}_app_" "${prefix}_service_" "${prefix}_version_" \
|
||||||
"${prefix}_backup_file_" "${prefix}_args_" "${prefix}_secret_" \
|
"${prefix}_src_" "${prefix}_dst_" "${prefix}_backup_file_" "${prefix}_args_" \
|
||||||
"${prefix}_cmd_" "${prefix}_data_" "${prefix}_command_" "${prefix}_recipe_" \
|
"${prefix}_secret_" "${prefix}_cmd_" "${prefix}_data_" "${prefix}_command_" \
|
||||||
"${prefix}_host_" "${prefix}_user_" "${prefix}_port_" "${prefix}_provider_" \
|
"${prefix}_recipe_" "${prefix}_host_" "${prefix}_user_" "${prefix}_port_" \
|
||||||
"${prefix}_subcommands_" "${prefix}app" "${prefix}list" "${prefix}ls" \
|
"${prefix}_provider_" "${prefix}_subcommands_" "${prefix}app" "${prefix}list" \
|
||||||
"${prefix}new" "${prefix}backup" "${prefix}deploy" "${prefix}check" \
|
"${prefix}ls" "${prefix}new" "${prefix}backup" "${prefix}deploy" \
|
||||||
"${prefix}version" "${prefix}config" "${prefix}cp" "${prefix}logs" \
|
"${prefix}check" "${prefix}version" "${prefix}config" "${prefix}cp" \
|
||||||
"${prefix}ps" "${prefix}restore" "${prefix}rm" "${prefix}delete" \
|
"${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
|
||||||
"${prefix}run" "${prefix}rollback" "${prefix}secret" "${prefix}generate" \
|
"${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}secret" \
|
||||||
"${prefix}insert" "${prefix}undeploy" "${prefix}recipe" "${prefix}versions" \
|
"${prefix}generate" "${prefix}insert" "${prefix}undeploy" "${prefix}recipe" \
|
||||||
"${prefix}server" "${prefix}add" "${prefix}init" "${prefix}apps" \
|
"${prefix}release" "${prefix}versions" "${prefix}server" "${prefix}add" \
|
||||||
"${prefix}upgrade" "${prefix}doctor" "${prefix}help"
|
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}doctor" \
|
||||||
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
|
"${prefix}help"; eval "${prefix}"'__help=${var___help:-false}'
|
||||||
eval "${prefix}"'__debug=${var___debug:-false}'
|
|
||||||
eval "${prefix}"'__stack=${var___stack:-}'
|
eval "${prefix}"'__stack=${var___stack:-}'
|
||||||
eval "${prefix}"'__help=${var___help:-false}'
|
|
||||||
eval "${prefix}"'__verbose=${var___verbose:-false}'
|
|
||||||
eval "${prefix}"'__skip_update=${var___skip_update:-false}'
|
eval "${prefix}"'__skip_update=${var___skip_update:-false}'
|
||||||
eval "${prefix}"'__env=${var___env:-}'
|
eval "${prefix}"'__env=${var___env:-}'
|
||||||
eval "${prefix}"'__branch=${var___branch:-}'
|
eval "${prefix}"'__branch=${var___branch:-}'
|
||||||
|
eval "${prefix}"'__verbose=${var___verbose:-false}'
|
||||||
|
eval "${prefix}"'__skip_check=${var___skip_check:-false}'
|
||||||
|
eval "${prefix}"'__debug=${var___debug:-false}'
|
||||||
eval "${prefix}"'__no_prompt=${var___no_prompt:-false}'
|
eval "${prefix}"'__no_prompt=${var___no_prompt:-false}'
|
||||||
eval "${prefix}"'__status=${var___status:-false}'
|
eval "${prefix}"'__status=${var___status:-false}'
|
||||||
eval "${prefix}"'__server=${var___server:-}'
|
eval "${prefix}"'__server=${var___server:-}'
|
||||||
@ -326,6 +330,7 @@ eval "${prefix}"'generate=${var_generate:-false}'
|
|||||||
eval "${prefix}"'insert=${var_insert:-false}'
|
eval "${prefix}"'insert=${var_insert:-false}'
|
||||||
eval "${prefix}"'undeploy=${var_undeploy:-false}'
|
eval "${prefix}"'undeploy=${var_undeploy:-false}'
|
||||||
eval "${prefix}"'recipe=${var_recipe:-false}'
|
eval "${prefix}"'recipe=${var_recipe:-false}'
|
||||||
|
eval "${prefix}"'release=${var_release:-false}'
|
||||||
eval "${prefix}"'versions=${var_versions:-false}'
|
eval "${prefix}"'versions=${var_versions:-false}'
|
||||||
eval "${prefix}"'server=${var_server:-false}'
|
eval "${prefix}"'server=${var_server:-false}'
|
||||||
eval "${prefix}"'add=${var_add:-false}'
|
eval "${prefix}"'add=${var_add:-false}'
|
||||||
@ -335,9 +340,9 @@ eval "${prefix}"'upgrade=${var_upgrade:-false}'
|
|||||||
eval "${prefix}"'doctor=${var_doctor:-false}'
|
eval "${prefix}"'doctor=${var_doctor:-false}'
|
||||||
eval "${prefix}"'help=${var_help:-false}'; local docopt_i=1
|
eval "${prefix}"'help=${var_help:-false}'; local docopt_i=1
|
||||||
[[ $BASH_VERSION =~ ^4.3 ]] && docopt_i=2; for ((;docopt_i>0;docopt_i--)); do
|
[[ $BASH_VERSION =~ ^4.3 ]] && docopt_i=2; for ((;docopt_i>0;docopt_i--)); do
|
||||||
declare -p "${prefix}__skip_check" "${prefix}__debug" "${prefix}__stack" \
|
declare -p "${prefix}__help" "${prefix}__stack" "${prefix}__skip_update" \
|
||||||
"${prefix}__help" "${prefix}__verbose" "${prefix}__skip_update" \
|
"${prefix}__env" "${prefix}__branch" "${prefix}__verbose" \
|
||||||
"${prefix}__env" "${prefix}__branch" "${prefix}__no_prompt" \
|
"${prefix}__skip_check" "${prefix}__debug" "${prefix}__no_prompt" \
|
||||||
"${prefix}__status" "${prefix}__server" "${prefix}__type" "${prefix}__domain" \
|
"${prefix}__status" "${prefix}__server" "${prefix}__type" "${prefix}__domain" \
|
||||||
"${prefix}__app_name" "${prefix}__pass" "${prefix}__secrets" "${prefix}__all" \
|
"${prefix}__app_name" "${prefix}__pass" "${prefix}__secrets" "${prefix}__all" \
|
||||||
"${prefix}__update" "${prefix}__force" "${prefix}__skip_version_check" \
|
"${prefix}__update" "${prefix}__force" "${prefix}__skip_version_check" \
|
||||||
@ -352,8 +357,9 @@ declare -p "${prefix}__skip_check" "${prefix}__debug" "${prefix}__stack" \
|
|||||||
"${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
|
"${prefix}logs" "${prefix}ps" "${prefix}restore" "${prefix}rm" \
|
||||||
"${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}secret" \
|
"${prefix}delete" "${prefix}run" "${prefix}rollback" "${prefix}secret" \
|
||||||
"${prefix}generate" "${prefix}insert" "${prefix}undeploy" "${prefix}recipe" \
|
"${prefix}generate" "${prefix}insert" "${prefix}undeploy" "${prefix}recipe" \
|
||||||
"${prefix}versions" "${prefix}server" "${prefix}add" "${prefix}init" \
|
"${prefix}release" "${prefix}versions" "${prefix}server" "${prefix}add" \
|
||||||
"${prefix}apps" "${prefix}upgrade" "${prefix}doctor" "${prefix}help"; done; }
|
"${prefix}init" "${prefix}apps" "${prefix}upgrade" "${prefix}doctor" \
|
||||||
|
"${prefix}help"; done; }
|
||||||
# docopt parser above, complete command for generating this parser is `docopt.sh abra`
|
# docopt parser above, complete command for generating this parser is `docopt.sh abra`
|
||||||
|
|
||||||
PROGRAM_NAME=$(basename "$0")
|
PROGRAM_NAME=$(basename "$0")
|
||||||
@ -633,11 +639,11 @@ load_abra_sh() {
|
|||||||
if [ -f abra.sh ]; then
|
if [ -f abra.sh ]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source abra.sh
|
source abra.sh
|
||||||
info "Loading abra.sh"
|
debug "Loading ./abra.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$APP_DIR/abra.sh" ]; then
|
if [ -f "$APP_DIR/abra.sh" ]; then
|
||||||
info "Loading $APP_DIR/abra.sh"
|
debug "Loading $APP_DIR/abra.sh"
|
||||||
# shellcheck disable=SC1090,SC1091
|
# shellcheck disable=SC1090,SC1091
|
||||||
source "$APP_DIR/abra.sh"
|
source "$APP_DIR/abra.sh"
|
||||||
fi
|
fi
|
||||||
@ -1854,7 +1860,6 @@ sub_recipe_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
###### .. recipe <recipe> versions
|
###### .. recipe <recipe> versions
|
||||||
|
|
||||||
help_recipe_versions() {
|
help_recipe_versions() {
|
||||||
echo "abra [options] recipe versions
|
echo "abra [options] recipe versions
|
||||||
|
|
||||||
@ -1879,6 +1884,121 @@ sub_recipe_versions() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###### .. recipe <recipe> release
|
||||||
|
help_recipe_release() {
|
||||||
|
echo "abra [options] recipe <recipe> release
|
||||||
|
|
||||||
|
(For app maintainers)
|
||||||
|
|
||||||
|
Make sure the service labels and git tags for <recipe> are in sync with the
|
||||||
|
specified image tags.
|
||||||
|
|
||||||
|
Run this after you have (or comrade \`renovate-bot\` has) bumped the version of
|
||||||
|
any of the images in <recipe>."
|
||||||
|
}
|
||||||
|
|
||||||
|
sub_recipe_release() {
|
||||||
|
require_binary skopeo
|
||||||
|
require_yq
|
||||||
|
|
||||||
|
recipe="$abra__recipe_"
|
||||||
|
recipe_dir="$ABRA_DIR/apps/$recipe"
|
||||||
|
|
||||||
|
get_recipe_versions "$recipe"
|
||||||
|
latest_version="${RECIPE_VERSIONS[-1]}"
|
||||||
|
|
||||||
|
cd "$recipe_dir" || error "Can't find recipe dir '$recipe_dir'"
|
||||||
|
|
||||||
|
current_tag=$(git tag --points-at HEAD)
|
||||||
|
if [ -n "$current_tag" ]; then
|
||||||
|
error "$recipe is already on $current_tag, no release needed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mapfile -t extra_compose_files < <(ls -- compose.*.yml || true)
|
||||||
|
|
||||||
|
compose_files=("compose.yml" "${extra_compose_files[@]}")
|
||||||
|
|
||||||
|
new_version="false"
|
||||||
|
|
||||||
|
for compose_file in "${compose_files[@]}"; do
|
||||||
|
mapfile -t services < <($YQ e -N '.services | keys | .[]' "$compose_file" | sort -u)
|
||||||
|
|
||||||
|
for service in "${services[@]}"; do
|
||||||
|
# 3wc: skip the "app" service unless we're in compose.yml; this service is
|
||||||
|
# often repeated in other compose.*.yml files to extend options, but we only
|
||||||
|
# want to add the deploy.label in one definition
|
||||||
|
# TODO 3wc: make this smarter, what if a separate compose file extends
|
||||||
|
# other services too?
|
||||||
|
if [ "$compose_file" != "compose.yml" ] && [ "$service" = "app" ]; then
|
||||||
|
debug "skipping '$service'"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
debug "processing '$service'"
|
||||||
|
|
||||||
|
service_image=$($YQ e ".services.$service.image" "$compose_file")
|
||||||
|
service_tag="${service_image##*:}"
|
||||||
|
|
||||||
|
latest_data=$($JQ ".$recipe.versions.\"$latest_version\".\"$service\"" "$ABRA_APPS_JSON")
|
||||||
|
latest_tag="$(echo "$latest_data" | $JQ -r ".tag" -)"
|
||||||
|
|
||||||
|
if [ "$service_tag" != "$latest_tag" ]; then
|
||||||
|
if [ "$service" = "app" ]; then
|
||||||
|
new_version="$service_tag"
|
||||||
|
fi
|
||||||
|
info "fetching $service_image metadata from Docker Hub"
|
||||||
|
service_data=$(skopeo inspect "docker://$service_image")
|
||||||
|
service_digest=$(echo "$service_data" | jq -r '.Digest' | cut -d':' -f2 | cut -c-8)
|
||||||
|
|
||||||
|
label="coop-cloud.\${STACK_NAME}.$service.version=${service_tag}-${service_digest}"
|
||||||
|
|
||||||
|
debug "Replacing version label on $service with $label"
|
||||||
|
|
||||||
|
# delete old label, if one exists
|
||||||
|
$YQ eval -i "del(.services.$service.deploy.labels.[] | select(. == \"coop*\"))" "$compose_file"
|
||||||
|
# add new label
|
||||||
|
$YQ eval -i ".services.$service.deploy.labels += [\"$label\"]" "$compose_file"
|
||||||
|
else
|
||||||
|
debug "no updates for $service"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$new_version" = "false" ]; then
|
||||||
|
# `app` tag hasn't changed, just bump release
|
||||||
|
if echo "$latest_version" | grep -q '_'; then
|
||||||
|
latest_version_minor="${latest_version##*_}"
|
||||||
|
else
|
||||||
|
latest_version_minor=0
|
||||||
|
fi
|
||||||
|
new_version_minor="$((latest_version_minor + 1))"
|
||||||
|
new_version="${latest_version%%*_}_$new_version_minor"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug "Calculated new version $new_version"
|
||||||
|
|
||||||
|
if [ "$new_version" = "$latest_version" ]; then
|
||||||
|
error "Hmm, something went wrong generating a new version number.."
|
||||||
|
fi
|
||||||
|
|
||||||
|
success "All compose files updated; new version is $new_version"
|
||||||
|
|
||||||
|
read -rp "Commit your changes to git? (y/[n])? " choice
|
||||||
|
|
||||||
|
if [ "${choice,,}" != "y" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
git commit -av || exit
|
||||||
|
|
||||||
|
read -rp "Tag this as \`$new_version\`? (y/[n])? " choice
|
||||||
|
|
||||||
|
if [ "${choice,,}" != "y" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
git tag -a "$new_version"
|
||||||
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# abra server ..
|
# abra server ..
|
||||||
#######################################
|
#######################################
|
||||||
|
Loading…
Reference in New Issue
Block a user