Documentation ¶
Index ¶
- Variables
- type App
- func (a *App) BuildStatus(build *codebuild.Build) (*DeployStatus, error)
- func (a *App) ConnectToTask(task *ecs.Task, cmd *string) error
- func (a *App) CreateScheduledTask(schedule string, command string) ([]*ScheduledTask, error)
- func (a *App) DeleteScheduledTask(idx int) (*ScheduledTask, error)
- func (a *App) DescribeTasks() ([]*ecs.Task, error)
- func (a *App) GetBuildArtifact(build *codebuild.Build, name string) ([]byte, error)
- func (a *App) GetConsoleURL(destinationURL string) (*string, error)
- func (a *App) GetDeployStatus(buildARN string) (*DeployStatus, error)
- func (a *App) LastBuild() (*codebuild.Build, error)
- func (a *App) ListBuilds() ([]*codebuild.Build, error)
- func (a *App) LoadDeployStatus() error
- func (a *App) LoadECSConfig() error
- func (a *App) LoadSettings() error
- func (a *App) ResizeProcess(processType string, cpu int, memory int) error
- func (a *App) ScaleProcess(processType string, minProcessCount int, maxProcessCount int) error
- func (a *App) ScheduledTasks() ([]*ScheduledTask, error)
- func (a *App) StartBuild() (*codebuild.Build, error)
- func (a *App) StartTask(taskFamily *string, command []string, fargate bool) (*ecs.RunTaskOutput, error)
- func (a *App) ValidateCronString(rule string) error
- func (a *App) WaitForTaskRunning(task *ecs.Task) error
- func (a *App) WaitForTaskStopped(task *ecs.Task) error
- type DeployStatus
- type ECSConfig
- type Process
- type Scaling
- type ScheduledTask
- type Settings
Constants ¶
This section is empty.
Variables ¶
var ShellBackgroundCommand = []string{ "/bin/sh", "-c", strings.Join([]string{ "EXPECTED_PROCS=\"$(ls -1 /proc | grep -c [0-9])\"", "STOP=$(($(date +%s)+" + fmt.Sprintf("%d", maxLifetime) + "))", "sleep " + fmt.Sprintf("%d", waitForConnect), "while true", "do PROCS=\"$(ls -1 /proc | grep -c [0-9])\"", "test \"$PROCS\" -le \"$EXPECTED_PROCS\" && exit", "test \"$STOP\" -lt \"$(date +%s)\" && exit 1", "sleep 30", "done", }, "; "), }
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Name string Session *session.Session Settings *Settings ECSConfig *ECSConfig DeployStatus *DeployStatus PendingDeployStatuses []*DeployStatus }
App is a representation of a AppPack app
func (*App) BuildStatus ¶
func (a *App) BuildStatus(build *codebuild.Build) (*DeployStatus, error)
BuildStatus checks the status of a CodeBuild run
func (*App) ConnectToTask ¶
ConnectToTask open a SSM Session to the Docker host and exec into container
func (*App) CreateScheduledTask ¶
func (a *App) CreateScheduledTask(schedule string, command string) ([]*ScheduledTask, error)
CreateScheduledTask adds a scheduled task for the app
func (*App) DeleteScheduledTask ¶
func (a *App) DeleteScheduledTask(idx int) (*ScheduledTask, error)
DeleteScheduledTask deletes the scheduled task at the given index
func (*App) DescribeTasks ¶
DescribeTasks generate a URL which will sign the user in to the AWS console and redirect to the desinationURL
func (*App) GetBuildArtifact ¶
GetBuildArtifact retrieves an artifact stored in S3
func (*App) GetConsoleURL ¶
GetConsoleURL generate a URL which will sign the user in to the AWS console and redirect to the desinationURL
func (*App) GetDeployStatus ¶
func (a *App) GetDeployStatus(buildARN string) (*DeployStatus, error)
GetDeployStatus will get a DeployStatus value from DDB
func (*App) ListBuilds ¶
ListBuilds lists recent CodeBuild runs
func (*App) LoadDeployStatus ¶
LoadDeployStatus will set the app.DeployStatus value from DDB
func (*App) LoadECSConfig ¶
LoadECSConfig will set the app.ECSConfig value from DDB
func (*App) LoadSettings ¶
LoadSettings will set the app.Settings value from DDB
func (*App) ResizeProcess ¶
func (*App) ScaleProcess ¶
func (*App) ScheduledTasks ¶
func (a *App) ScheduledTasks() ([]*ScheduledTask, error)
ScheduledTasks lists scheduled tasks for the app
func (*App) StartBuild ¶
StartBuild starts a new CodeBuild run
func (*App) StartTask ¶
func (a *App) StartTask(taskFamily *string, command []string, fargate bool) (*ecs.RunTaskOutput, error)
StartTask start a new task on ECS
func (*App) ValidateCronString ¶
ValidateCronString validates a cron schedule rule
func (*App) WaitForTaskRunning ¶
WaitForTaskRunning waits for a task to be running or complete
type DeployStatus ¶
type ECSConfig ¶
type ECSConfig struct { RunTaskArgs ecs.RunTaskInput `locationName:"run_task_args"` RunTaskArgsFargate ecs.RunTaskInput `locationName:"run_task_args_fargate"` }
type ScheduledTask ¶
type Settings ¶
type Settings struct { Cluster struct { ARN string `json:"arn"` Name string `json:"name"` } `json:"cluster"` Shell struct { Command string `json:"command"` TaskFamily string `json:"task_family"` } `json:"shell"` DBUtils struct { ShellTaskFamily string `json:"shell_task_family"` S3Bucket string `json:"s3_bucket"` DumpLoadTaskFamily string `json:"dumpload_task_family"` Engine string `json:"engine"` } `json:"dbutils"` CodebuildProject struct { Name string `json:"name"` } `json:"codebuild_project"` LogGroup struct { Name string `json:"name"` } `json:"log_group"` }