command

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupApp

func CleanupApp(
	deploymentsReader domain.DeploymentsReader,
	reader domain.AppsReader,
	writer domain.AppsWriter,
	backend domain.Backend,
) func(context.Context, CleanupAppCommand) error

Cleanup an application artifacts, images, networks, volumes and so on...

func CreateApp

func CreateApp(
	reader domain.AppsReader,
	writer domain.AppsWriter,
) func(context.Context, CreateAppCommand) (string, error)

Create a new application.

func Deploy

Process a deployment, this is where the magic happen!

func FailRunningDeployments

func FailRunningDeployments(
	reader domain.DeploymentsReader,
	writer domain.DeploymentsWriter,
) func(context.Context, error) error

Mark all running deployments as failed with the given reason. This is mostly used when the server has crashed or has been hard resetted and some job does not ended correctly. They will need a redeploy.

func Promote

func Promote(
	appsReader domain.AppsReader,
	reader domain.DeploymentsReader,
	writer domain.DeploymentsWriter,
	deploymentDirTemplate domain.DeploymentDirTemplate,
) func(context.Context, PromoteCommand) (int, error)

Promote a deployment to the production environment

func QueueDeployment

func QueueDeployment(
	appsReader domain.AppsReader,
	reader domain.DeploymentsReader,
	writer domain.DeploymentsWriter,
	trigger domain.Trigger,
	deploymentDirTemplate domain.DeploymentDirTemplate,
) func(ctx context.Context, cmd QueueDeploymentCommand) (int, error)

Queue a deployment for a given app and trigger. It will returns the deployment number created.

func Redeploy

func Redeploy(
	appsReader domain.AppsReader,
	reader domain.DeploymentsReader,
	writer domain.DeploymentsWriter,
	deploymentDirTemplate domain.DeploymentDirTemplate,
) func(context.Context, RedeployCommand) (int, error)

Request a redeploy of the given deployment.

func RequestAppCleanup

func RequestAppCleanup(
	reader domain.AppsReader,
	writer domain.AppsWriter,
) func(context.Context, RequestAppCleanupCommand) error

Mark the application for deletion.

func UpdateApp

func UpdateApp(
	reader domain.AppsReader,
	writer domain.AppsWriter,
) func(context.Context, UpdateAppCommand) error

Types

type CleanupAppCommand

type CleanupAppCommand struct {
	ID string
}

type CreateAppCommand

type CreateAppCommand struct {
	Name string                                               `json:"name"`
	VCS  monad.Maybe[VCSConfig]                               `json:"vcs"`
	Env  monad.Maybe[map[string]map[string]map[string]string] `json:"env"` // This is not so sweet but hey!
}

type DeployCommand

type DeployCommand struct {
	AppID            string
	DeploymentNumber int
}

type PromoteCommand

type PromoteCommand struct {
	AppID            string `json:"-"`
	DeploymentNumber int    `json:"-"`
}

type QueueDeploymentCommand

type QueueDeploymentCommand struct {
	AppID       string `json:"-"`
	Environment string `json:"-"`
	Payload     any    `json:"-"`
}

type RedeployCommand

type RedeployCommand struct {
	AppID            string `json:"-"`
	DeploymentNumber int    `json:"-"`
}

type RequestAppCleanupCommand

type RequestAppCleanupCommand struct {
	ID string `json:"-"`
}

type UpdateAppCommand

type UpdateAppCommand struct {
	ID  string                                               `json:"-"`
	VCS monad.Patch[VCSConfigUpdate]                         `json:"vcs"`
	Env monad.Patch[map[string]map[string]map[string]string] `json:"env"`
}

type VCSConfig

type VCSConfig struct {
	Url   string              `json:"url"`
	Token monad.Maybe[string] `json:"token"`
}

type VCSConfigUpdate

type VCSConfigUpdate struct {
	Url   monad.Maybe[string] `json:"url"`
	Token monad.Patch[string] `json:"token"`
}

Jump to

Keyboard shortcuts

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