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

Merge pull request #296 from robertstettner/added-godotenv-for-non-base

Added env-file with godotenv to all non-base implementations of plugin
This commit is contained in:
Brad Rydzewski 2020-08-11 11:24:23 -04:00 committed by GitHub
commit e4056d8499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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")