mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
refactor out variadic form of GetDeployingAppImageName
This commit is contained in:
@@ -82,15 +82,7 @@ func LogFail(text string) {
|
||||
}
|
||||
|
||||
// GetDeployingAppImageName returns deploying image identifier for a given app, tag tuple. validate if tag is presented
|
||||
func GetDeployingAppImageName(args ...string) (imageName string) {
|
||||
argArray := make([]string, 3)
|
||||
for idx, arg := range args {
|
||||
argArray[idx] = arg
|
||||
}
|
||||
appName := argArray[0]
|
||||
imageTag := argArray[1]
|
||||
imageRepo := argArray[2]
|
||||
|
||||
func GetDeployingAppImageName(appName, imageTag, imageRepo string) (imageName string) {
|
||||
if appName == "" {
|
||||
LogFail("(GetDeployingAppImageName) APP must not be empty")
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func purgeCache() {
|
||||
|
||||
cacheDir := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName, "cache"}, "/")
|
||||
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
|
||||
image := common.GetDeployingAppImageName(appName)
|
||||
image := common.GetDeployingAppImageName(appName, "", "")
|
||||
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
|
||||
purgeCacheCmd := common.NewDokkuCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs,
|
||||
"-v", strings.Join([]string{cacheDir, ":/cache"}, ""), image,
|
||||
|
||||
Reference in New Issue
Block a user