Documentation ¶
Index ¶
- Variables
- func Build(ctx context.Context) error
- func BuildDockerComposeArgs(pname, ptype, namespace, file string) []string
- func Exec(bin string, args ...string) error
- func Install(ctx context.Context) error
- func Setup(ctx context.Context) error
- func Test(ctx context.Context)
- func Upgrade(ctx context.Context) error
- func WriteEnvFile(filename string, vars map[string]string, comments ...string) error
- type CMDEnv
- type Dev
- type DockerImage
- type Mod
- type Protos
- type Tests
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ProjectType configures type of the project. ProjectType = "service" // ProjectName configures the name of the project. ProjectName = "service" // GitBin is the executable name of Git. GitBin = "git" // GoBin is the executable name of Go. GoBin = "go" // DockerBin is the executable name of Docker. DockerBin = "docker" // ComposeBin is the executable name of Docker Compose. ComposeBin = "docker-compose" // LocalHost is the IP or hostname of your local machine. LocalHost = "127.0.0.1" // MigrationsURLEnvVar is the name of the migrations URL environment variable. MigrationsURLEnvVar = "MIGRATIONS_URL" // MigrationsURLLocal is the environment variable for the migrations path in the local environment. MigrationsURLLocal = "file://service/database/migrations" // MigrationsURLDev is the environment variable for the migrations path in the development environment. MigrationsURLDev = "file:///migrations" // MigrationsURLTest is the environment variable for the migrations path in the test environment. MigrationsURLTest = "file:///service/service/database/migrations" )
View Source
var ( // DockerDir describes the path of the docker directory relative to the project root. DockerDir = "docker" // DockerBuildImage is the image used to build Go projects. DockerBuildImage = DockerBuildImageStandard // DockerRunImage is the image used to run Go projects. DockerRunImage = DockerRunImageStandard // DockerComposeTestFile configures the file that should be used for docker compose test environment. DockerComposeTestFile = path.Join(DockerDir, "test.yml") // DockerComposeTestEnvironment describes the environment variables that should be sent to docker compose apps in test. DockerComposeTestEnvironment = map[string]string{} // DockerComposeTestDependencies describe all dependencies that should be started in the docker compose test environment. DockerComposeTestDependencies = []string{} // DockerComposeDevFile configures the file that should be used for docker compose development environment. DockerComposeDevFile = path.Join(DockerDir, "dev.yml") // DockerComposeDevEnvironment describes the environment variables that should be sent to docker compose apps in development. DockerComposeDevEnvironment = map[string]string{} // DockerComposeDevDependencies describe all dependencies that should be started in the docker compose development environment. DockerComposeDevDependencies = []string{} )
View Source
var ( // InfraDir represents the directory used for infrastructure files. InfraDir = "infra" // GCPStageChartFile configures the file path to the gcp chart for stage. GCPStageChartFile = path.Join(InfraDir, "stage.gcp.yaml") // GCPProdChartFile configures the file path to the gcp chart for prod. GCPProdChartFile = path.Join(InfraDir, "prod.gcp.yaml") )
View Source
var ( // ProtoDefinitionsRepo is the central repository used for proto definitions. ProtoDefinitionsRepo = "git@gitlab.com:LUSHDigital/soa/models/rpc.git" // ProtoDefinitionsBranch is the branch of the protos repository to check out. ProtoDefinitionsBranch = "master" // ProtoOutputPath is the path where the generated protos should be output to. ProtoOutputPath = "service" // ProtoServices are the service protobuffers that should be generated with lush-protogen. ProtoServices = []string{} // ProtoAggregators are the aggregator protobuffers that should be generated with lush-protogen. ProtoAggregators = []string{} )
View Source
var ( // MageTargetsRepo is the repository used for importing mage targets. MageTargetsRepo = "github.com/LUSHDigital/core-mage" // InstallVolume is used to set what volume to use during the `mage install` target. InstallVolume string = "${PWD}:/repo" // InstallWorkDir is used to set what work directory to use during the `mage install` target. InstallWorkDir string = "/repo" )
View Source
var Environment = CMDEnv{ "GOPATH": os.Getenv("GOPATH"), "GOPROXY": os.Getenv("GOPROXY"), "GOMODPATH": os.Getenv("GOMODPATH"), "PWD": os.Getenv("PWD"), }
Environment describes the environment variables that should be sent with the target.
View Source
var (
// SubmodulesPath is used to describe what path to use for git submodules.
SubmodulesPath = "modules/"
)
Functions ¶
func BuildDockerComposeArgs ¶
BuildDockerComposeArgs will construct arguments for docker compose.
Types ¶
type CMDEnv ¶
CMDEnv is used to wrap the command environment with convenience methods.
type Dev ¶
Dev is the namespace for actions related to the development environment.
type DockerImage ¶
type DockerImage = string
DockerImage represents a reference to a remote docker image
const ( // DockerRunImageMigrations specifices the docker image for running a Go service with migrations. DockerRunImageMigrations DockerImage = "lushdigital/alpine-service:migrations" // DockerRunImageStandard specifices the docker image for running a Go regular service. DockerRunImageStandard DockerImage = "lushdigital/alpine-service:standard" // DockerBuildImageStandard specifices the docker image for building a regular Go service. DockerBuildImageStandard DockerImage = "lushdigital/alpine-golang:latest" )
type Mod ¶
Mod is the namespace for actions related to installing modules.
type Protos ¶
Protos is the namespace for actions related to generating protobuffers.
type Tests ¶
Tests is the namespace for actions related to the test environment.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.