feat: refactor to use network plugin

- Add proxy-build-config hook to rebuild network and proxy settings for an application
- Scope nginx:build-config to work only when it is the configured proxy for an application
- Refactor deploy code to interact with network plugin for computed and actual ipaddr/port settings
- Ensure the proxy-build-config plugin trigger is called on ps:restore
- Expose a few plugin triggers for retrieving networking information for a given APP/PROC_TYPE/CONTAINER_ID combination
This commit is contained in:
Jose Diaz-Gonzalez
2017-04-21 02:19:25 -06:00
committed by Michael Hobbs
parent ec9b8be5f8
commit 1835b04809
10 changed files with 182 additions and 44 deletions

View File

@@ -4,8 +4,8 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
network-write-config() {
declare desc="writes the network config files out"
network-build-config() {
declare desc="builds network config files"
declare APP="$1"; verify_app_name "$APP"
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
@@ -41,7 +41,7 @@ network-write-config() {
}
network-compute-container-ports() {
declare desc="Return the ipaddr for a given app container"
declare desc="Computes the ports for a given app container"
declare APP="$1" PROC_TYPE="$2"
local PORTS
@@ -72,7 +72,6 @@ network-compute-container-ports() {
echo "$PORTS"
}
network-get-container-ipaddr() {
declare desc="Return the ipaddr for a given app container"
declare APP="$1" PROC_TYPE="$2" CONTAINER_ID="$3"
@@ -96,7 +95,7 @@ network-get-container-ipaddr() {
}
network-get-container-port() {
declare desc="Return the ipaddr for a given app container"
declare desc="Return the port for a given app container"
declare APP="$1" PROC_TYPE="$2" CID="$3"
local DOKKU_IS_APP_PROXY_ENABLED
local PORT=5000