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

Added env-file with godotenv to all non-base implementations of plugin

This commit is contained in:
Robert Stettner 2020-08-05 16:28:21 +01:00
parent d913d6e7dc
commit a5076e74dc
4 changed files with 28 additions and 0 deletions

View File

@ -5,9 +5,16 @@ import (
"os" "os"
"os/exec" "os/exec"
"strings" "strings"
"github.com/joho/godotenv"
) )
func main() { func main() {
// Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
godotenv.Load(env)
}
var ( var (
repo = getenv("PLUGIN_REPO") repo = getenv("PLUGIN_REPO")
registry = getenv("PLUGIN_REGISTRY") registry = getenv("PLUGIN_REGISTRY")

View File

@ -10,6 +10,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/joho/godotenv"
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds"
@ -20,6 +22,11 @@ import (
const defaultRegion = "us-east-1" const defaultRegion = "us-east-1"
func main() { func main() {
// Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
godotenv.Load(env)
}
var ( var (
repo = getenv("PLUGIN_REPO") repo = getenv("PLUGIN_REPO")
registry = getenv("PLUGIN_REGISTRY") registry = getenv("PLUGIN_REGISTRY")

View File

@ -6,12 +6,19 @@ import (
"os/exec" "os/exec"
"path" "path"
"strings" "strings"
"github.com/joho/godotenv"
) )
// gcr default username // gcr default username
const username = "_json_key" const username = "_json_key"
func main() { func main() {
// Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
godotenv.Load(env)
}
var ( var (
repo = getenv("PLUGIN_REPO") repo = getenv("PLUGIN_REPO")
registry = getenv("PLUGIN_REGISTRY") registry = getenv("PLUGIN_REGISTRY")

View File

@ -4,9 +4,16 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"github.com/joho/godotenv"
) )
func main() { func main() {
// Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
godotenv.Load(env)
}
var ( var (
registry = "registry.heroku.com" registry = "registry.heroku.com"
process = getenv("PLUGIN_PROCESS_TYPE") process = getenv("PLUGIN_PROCESS_TYPE")