feat: allow checking if a service is linked to an app
This commit is contained in:
@@ -288,6 +288,20 @@ service_info() {
|
||||
fi
|
||||
}
|
||||
|
||||
service_is_linked() {
|
||||
declare desc="Links a service to an application"
|
||||
declare SERVICE="$1" APP="$2"
|
||||
update_plugin_scheme_for_app "$APP"
|
||||
local SERVICE_URL=$(service_url "$SERVICE")
|
||||
local EXISTING_CONFIG=$(config_all "$APP")
|
||||
local LINK=$(echo "$EXISTING_CONFIG" | grep "$SERVICE_URL" | cut -d: -f1) || true
|
||||
if [[ -z $LINK ]]; then
|
||||
dokku_log_warn "Service $SERVICE is not linked to $APP"
|
||||
exit 1
|
||||
fi
|
||||
dokku_log_info1 "Service $SERVICE is linked to $APP"
|
||||
}
|
||||
|
||||
service_link() {
|
||||
declare desc="Links a service to an application"
|
||||
declare SERVICE="$1" APP="$2"
|
||||
|
||||
Reference in New Issue
Block a user