graphql-engine/cli/internal/testutil/vars.go
Aravind K P c7ac1ede3f cli: add migrate and metadata packages
>

### 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
2021-06-18 06:25:14 +00:00

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"
}()
)