feat: add helper for fetching AppRoot in golang

This commit is contained in:
Jose Diaz-Gonzalez
2020-03-10 14:12:05 -04:00
parent cd21e90edf
commit 3f0c46d43d
4 changed files with 13 additions and 10 deletions

View File

@@ -69,6 +69,12 @@ func (sc *ShellCmd) Output() ([]byte, error) {
return sc.Command.Output()
}
// AppRoot returns the app root path
func AppRoot(appName string) string {
dokkuRoot := MustGetEnv("DOKKU_ROOT")
return fmt.Sprintf("%v/%v", dokkuRoot, appName)
}
// GetDeployingAppImageName returns deploying image identifier for a given app, tag tuple. validate if tag is presented
func GetDeployingAppImageName(appName, imageTag, imageRepo string) (imageName string) {
if appName == "" {