feat: implement proxy container :label functionality
This commit is contained in:
committed by
Jose Diaz-Gonzalez
parent
e93175b37e
commit
4eafd3b5b7
@@ -1,9 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-openresty-label() {
|
||||
declare desc="set/unset/show container proxy labels"
|
||||
declare cmd="openresty:label"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
set -- openresty "$@"
|
||||
cmd-proxy-label "$@"
|
||||
}
|
||||
|
||||
cmd-openresty-report() {
|
||||
declare desc="displays a openresty report for one or more apps"
|
||||
declare cmd="openresty:report"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"
|
||||
|
||||
trigger-openresty-vhosts-docker-args-process-deploy() {
|
||||
@@ -181,6 +182,15 @@ trigger-openresty-vhosts-docker-args-process-deploy() {
|
||||
value="$(fn-openresty-x-forwarded-ssl "$APP")"
|
||||
[[ -n "$value" ]] && output="$output '--label=openresty.x-forwarded-ssl=$value'"
|
||||
|
||||
local proxy_labels_file_path=$(fn-proxy-get-labels-file-path "$APP" openresty)
|
||||
fn-proxy-report-label-overwrite "$output" "$proxy_labels_file_path"
|
||||
|
||||
if [[ -f "$proxy_labels_file_path" ]]; then
|
||||
local user_proxy_labels="$(<"$proxy_labels_file_path")"
|
||||
user_proxy_labels="$(echo "$user_proxy_labels" | tr '\r\n' ' ')"
|
||||
output="$output $user_proxy_labels"
|
||||
fi
|
||||
|
||||
echo -n "$STDIN$output"
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ fn-help-content() {
|
||||
openresty:report [<app>] [<flag>], Displays an openresty report for one or more apps
|
||||
openresty:set <app> <property> (<value>), Set or clear an openresty property for an app
|
||||
openresty:show-config <app>, Display openresty compose config
|
||||
openresty:label <app> <show | set | unset> <property> (<value>), Show, set or clear an openresty label for an app
|
||||
openresty:start, Starts the openresty server
|
||||
openresty:stop, Stops the openresty server
|
||||
help_content
|
||||
|
||||
6
plugins/openresty-vhosts/subcommands/label
Executable file
6
plugins/openresty-vhosts/subcommands/label
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/command-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-openresty-label "$@"
|
||||
Reference in New Issue
Block a user