|
|
|
|
@ -28,6 +28,7 @@ const ( |
|
|
|
|
Heroku = EnvType("hr") |
|
|
|
|
AzureAppService = EnvType("az") |
|
|
|
|
AWSFargate = EnvType("fg") |
|
|
|
|
FlyDotIo = EnvType("fly") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var envType atomic.Value // of EnvType
|
|
|
|
|
@ -57,6 +58,9 @@ func getEnvType() EnvType { |
|
|
|
|
if inAWSFargate() { |
|
|
|
|
return AWSFargate |
|
|
|
|
} |
|
|
|
|
if inFlyDotIo() { |
|
|
|
|
return FlyDotIo |
|
|
|
|
} |
|
|
|
|
return "" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -126,3 +130,10 @@ func inAWSFargate() bool { |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func inFlyDotIo() bool { |
|
|
|
|
if os.Getenv("FLY_APP_NAME") != "" && os.Getenv("FLY_REGION") != "" { |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|