feat: implement more of the registry plugin

This commit is contained in:
Jose Diaz-Gonzalez
2021-03-19 16:50:32 -04:00
parent 3848b467a2
commit 88cbae2a6d
4 changed files with 49 additions and 11 deletions

View File

@@ -3,10 +3,29 @@ package registry
import (
"fmt"
"strconv"
"strings"
"github.com/dokku/dokku/plugins/common"
)
func getRegistryServerForApp(appName string) string {
value := common.PropertyGet("registry", appName, "server")
if value == "" {
value = common.PropertyGet("registry", "--global", "server")
}
if value == "" {
value = DefaultProperties["server"]
}
value = strings.TrimSuffix(value, "/") + "/"
if value == "hub.docker.com/" || value == "docker.io/" {
value = ""
}
return value
}
func isPushEnabled(appName string) bool {
return reportComputedPushOnRelease(appName) == "true"
}