0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-22 20:20:39 +00:00

use the specified registry

This commit is contained in:
Ben Wilson 2018-10-26 10:24:12 -04:00
parent 9589237541
commit babff9c7ad

View File

@ -19,11 +19,12 @@ const defaultRegion = "us-east-1"
func main() { func main() {
var ( var (
repo = getenv("PLUGIN_REPO") repo = getenv("PLUGIN_REPO")
region = getenv("PLUGIN_REGION", "ECR_REGION", "AWS_REGION") registry = getenv("PLUGIN_REGISTRY")
key = getenv("PLUGIN_ACCESS_KEY", "ECR_ACCESS_KEY", "AWS_ACCESS_KEY_ID") region = getenv("PLUGIN_REGION", "ECR_REGION", "AWS_REGION")
secret = getenv("PLUGIN_SECRET_KEY", "ECR_SECRET_KEY", "AWS_SECRET_ACCESS_KEY") key = getenv("PLUGIN_ACCESS_KEY", "ECR_ACCESS_KEY", "AWS_ACCESS_KEY_ID")
create = parseBoolOrDefault(false, getenv("PLUGIN_CREATE_REPOSITORY", "ECR_CREATE_REPOSITORY")) secret = getenv("PLUGIN_SECRET_KEY", "ECR_SECRET_KEY", "AWS_SECRET_ACCESS_KEY")
create = parseBoolOrDefault(false, getenv("PLUGIN_CREATE_REPOSITORY", "ECR_CREATE_REPOSITORY"))
) )
// set the region // set the region
@ -45,7 +46,12 @@ func main() {
} }
svc := ecr.New(sess) svc := ecr.New(sess)
username, password, registry, err := getAuthInfo(svc) username, password, defaultRegistry, err := getAuthInfo(svc)
if registry == "" {
registry = defaultRegistry
}
if err != nil { if err != nil {
log.Fatal(fmt.Sprintf("error getting ECR auth: %v", err)) log.Fatal(fmt.Sprintf("error getting ECR auth: %v", err))
} }