mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
c7ac1ede3f
> ### Description > This PR adds two new packages which implement the CLI requirements specified in RFC:https://github.com/hasura/lux/blob/cloud/docs/rfcs/20210614_github_integration.md 1. `pkg/metadata` ![image](https://user-images.githubusercontent.com/8335904/122384828-b4757d80-cf89-11eb-9e21-ef116fb928e9.png) 2. `pkg/migrate` ![image](https://user-images.githubusercontent.com/8335904/122510554-68771700-d023-11eb-9f5d-046d2c0cf18a.png) ### Changelog - [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label. ### Affected components - [x] CLI https://github.com/hasura/graphql-engine-mono/pull/1598 GitOrigin-RevId: 0e2bce498386c5aae68dbca0fe383a6afff9d1a9
44 lines
912 B
Go
44 lines
912 B
Go
package testutil
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
)
|
|
|
|
// this can be overridden by ldflags
|
|
var (
|
|
HasuraDockerImage = func() string {
|
|
graphqlEngineDockerImage := os.Getenv("HASURA_TEST_CLI_HGE_DOCKER_IMAGE")
|
|
if graphqlEngineDockerImage != "" {
|
|
return graphqlEngineDockerImage
|
|
}
|
|
return ""
|
|
}()
|
|
|
|
TestAdminSecret = os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET")
|
|
|
|
DockerSwitchIP = func() string {
|
|
switch runtime.GOOS {
|
|
case "darwin", "windows":
|
|
return "host.docker.internal"
|
|
}
|
|
return "172.17.0.1"
|
|
}()
|
|
Hostname = "localhost"
|
|
BaseURL = fmt.Sprintf("http://%s", Hostname)
|
|
MSSQLPassword = "MSSQLp@ssw0rd"
|
|
CLIBinaryPath = func() string {
|
|
if os.Getenv("CI") == "true" {
|
|
return "/build/_cli_output/binaries/cli-hasura-linux-amd64"
|
|
}
|
|
|
|
hasuraCliPathEnv := os.Getenv("HASURA_TEST_CLI_PATH")
|
|
if hasuraCliPathEnv != "" {
|
|
return hasuraCliPathEnv
|
|
}
|
|
|
|
return "hasura"
|
|
}()
|
|
)
|