refactor: remove use of IP and PORT files from core-post-deploy plugin

This commit is contained in:
Jose Diaz-Gonzalez
2017-09-03 03:07:24 -04:00
committed by Michael Hobbs
parent 7fe2f8593c
commit dc00542b6f
5 changed files with 54 additions and 2 deletions

View File

@@ -76,6 +76,15 @@ func GetContainerPort(appName string, procType string, isHerokuishContainer bool
return port
}
// HasNetworkConfig returns whether the network configuration for a given app exists
func HasNetworkConfig(appName string) bool {
appRoot := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName}, "/")
ipfile := fmt.Sprintf("%v/IP.web.1", appRoot)
portfile := fmt.Sprintf("%v/PORT.web.1", appRoot)
return common.FileExists(ipfile) && common.FileExists(portfile)
}
// BuildConfig builds network config files
func BuildConfig(appName string) {
err := common.VerifyAppName(appName)