config

package
v1.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProjectNamePrefix will be appending to the name of the project.
	ProjectNamePrefix = "gitw-"

	// GitLabProjectBaseUrl is the base url used to create links to a specific CI/CD job or pipeline by ID.
	GitLabProjectBaseUrl = "https://gitlab.com/geeks-accelerator/oss/devops"

	// EnableRdsServerless will use the Aurora database engine that scales the capacity based on database load. This is
	// a good option for intermittent or unpredictable workloads.
	EnableRdsServerless = true

	// EnableElasticCache will include a Redis Elastic Cluster.
	EnableElasticCache = false
)
View Source
const (
	// EnableServiceElb will enable all services to be deployed with an ELB (Elastic Load Balancer).
	// This will only be applied to the prod env, but the logic can be changed in the code below.
	//
	// When enabled each service will require it's own ELB and therefore will add $20~ month per service when
	// this is enabled. The hostnames defined for the service will be updated in Route53 to resolve to the ELB.
	// If HTTPS is enabled, the ELB will be created with an AWS ACM certificate that will support SSL termination on
	// the ELB, all traffic will be sent to the container as HTTP.
	// This can be configured on a by service basis.
	//
	// When not enabled, tasks will be auto assigned a public IP. As ECS tasks for the service are launched/terminated,
	// the task will update the hostnames defined for the service in Route53 to either add/remove its public IP. This
	// option is good for services that only need one container running.
	EnableServiceElb = false

	// EnableServiceAutoscaling will enable all services to be deployed with an application scaling policy. This should
	// typically be enabled for front end services that have an ELB enabled.
	EnableServiceAutoscaling = false
)

Variables

View Source
var EnvNames = []Env{
	EnvDev,
	EnvStage,
	EnvProd,
}

List of env names used by main.go for help.

List of function names used by main.go for help and append the functions to config.

View Source
var ImageNames = []Image{
	ImageGoImagemagick7,
}

List of images names used by main.go for help and append the functions to config.

View Source
var ServiceNames = []Service{
	ServiceGoWebApi,
}

List of service names used by main.go for help and append the services to config.

Functions

func BuildFunctionForTargetEnv

func BuildFunctionForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, functionName, releaseTag string, dryRun, noCache, noPush bool) error

BuildFunctionForTargetEnv executes the build commands for a target function.

func BuildImageForTargetEnv added in v1.0.19

func BuildImageForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, imageName, releaseTag string, dryRun, noCache, noPush bool) error

BuildImageForTargetEnv executes the build commands for a target image.

func BuildServiceForTargetEnv

func BuildServiceForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, serviceName, releaseTag string, dryRun, noCache, noPush bool) error

BuildServiceForTargetEnv executes the build commands for a target service.

func DeployFunctionForTargetEnv

func DeployFunctionForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, functionName, releaseTag string, dryRun bool) error

DeployFunctionForTargetEnv executes the deploy commands for a target function.

func DeployInfrastructureForTargetEnv added in v1.0.13

func DeployInfrastructureForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, dryRun bool) error

DeployInfrastructureForTargetEnv executes the deploy commands for a target function.

func DeployServiceForTargetEnv

func DeployServiceForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, serviceName, releaseTag string, dryRun bool) error

DeployServiceForTargetEnv executes the build commands for a target service.

func NewConfig added in v1.0.13

func NewConfig(log *log.Logger, targetEnv Env, awsCredentials devdeploy.AwsCredentials) (*devdeploy.Config, error)

NewConfig defines the details to setup the target environment for the project to build services and functions.

func NewFunction added in v1.0.13

func NewFunction(log *log.Logger, funcName string, cfg *devdeploy.Config) (*devdeploy.ProjectFunction, error)

NewFunction returns the *devdeploy.ProjectFunction.

func NewImage added in v1.0.19

func NewImage(log *log.Logger, imageName string, cfg *devdeploy.Config) (*devdeploy.ProjectImage, error)

NewImage returns the *devdeploy.ProjectImage.

func NewService added in v1.0.13

func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*devdeploy.ProjectService, error)

NewService returns the ProjectService for a service that is configured for the target deployment env.

func RunSchemaMigrationsForTargetEnv

func RunSchemaMigrationsForTargetEnv(log *log.Logger, awsCredentials devdeploy.AwsCredentials, targetEnv Env, isUnittest bool) error

RunSchemaMigrationsForTargetEnv executes schema migrations for the target environment.

Types

type Env

type Env = string

Env defines the target deployment environment.

var (
	EnvDev   Env = "dev"
	EnvStage Env = "stage"
	EnvProd  Env = "prod"
)

type Function

type Function = string

Function define the name of a function.

var (
	FunctionDatadogLogcollector Function = "datadog-logcollector"
)

type Image added in v1.0.19

type Image = string

Image define the name of an image.

var (
	ImageGoImagemagick7 Image = "go-imagemagick7"
)

type Service

type Service = string

Service define the name of a service.

var (
	ServiceGoWebApi                   = "aws-ecs-go-web-api"
	ServiceBuildWithBaseImage Service = "build-with-base-image"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL