deploy

package
v0.1.56-pre-1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWaitTimeout           = 2 * time.Minute
	DefaultReleaseCommandTimeout = 5 * time.Minute
	DefaultLeaseTtl              = 13 * time.Second
	DefaultVMSize                = "shared-cpu-1x"
)

Variables

View Source
var (
	ErrAborted             = errors.New("deployment aborted by user")
	ErrWaitTimeout         = errors.New("wait for goroutine timeout")
	ErrCreateGreenMachine  = errors.New("failed to create green machines")
	ErrWaitForStartedState = errors.New("could not get all green machines into started state")
	ErrWaitForHealthy      = errors.New("could not get all green machines to be healthy")
	ErrMarkReadyForTraffic = errors.New("failed to mark green machines as ready")
	ErrDestroyBlueMachines = errors.New("failed to destroy previous deployment")
	ErrValidationError     = errors.New("app not in valid state for bluegreen deployments")
)
View Source
var CommonFlags = flag.Set{
	flag.Region(),
	flag.Image(),
	flag.Now(),
	flag.RemoteOnly(false),
	flag.LocalOnly(),
	flag.Push(),
	flag.Detach(),
	flag.Strategy(),
	flag.Dockerfile(),
	flag.Ignorefile(),
	flag.ImageLabel(),
	flag.BuildArg(),
	flag.BuildSecret(),
	flag.BuildTarget(),
	flag.NoCache(),
	flag.Nixpacks(),
	flag.BuildOnly(),
	flag.StringArray{
		Name:        "env",
		Shorthand:   "e",
		Description: "Set of environment variables in the form of NAME=VALUE pairs. Can be specified multiple times.",
	},
	flag.Bool{
		Name:        "auto-confirm",
		Description: "Will automatically confirm changes when running non-interactively.",
	},
	flag.Int{
		Name:        "wait-timeout",
		Description: "Seconds to wait for individual machines to transition states and become healthy.",
		Default:     int(DefaultWaitTimeout.Seconds()),
	},
	flag.String{
		Name:        "release-command-timeout",
		Description: "Seconds to wait for a release command finish running, or 'none' to disable.",
		Default:     strconv.Itoa(int(DefaultReleaseCommandTimeout.Seconds())),
	},
	flag.Int{
		Name:        "lease-timeout",
		Description: "Seconds to lease individual machines while running deployment. All machines are leased at the beginning and released at the end. The lease is refreshed periodically for this same time, which is why it is short. flyctl releases leases in most cases.",
		Default:     int(DefaultLeaseTtl.Seconds()),
	},
	flag.Bool{
		Name:        "force-nomad",
		Description: "(Deprecated) Use the Apps v1 platform built with Nomad",
		Default:     false,
		Hidden:      true,
	},
	flag.Bool{
		Name:        "force-machines",
		Description: "Use the Apps v2 platform built with Machines",
		Default:     false,
		Hidden:      true,
	},
	flag.String{
		Name:        "vm-size",
		Description: `The VM size to use when deploying for the first time. See "fly platform vm-sizes" for valid values`,
		Aliases:     []string{"size"},
	},
	flag.Bool{
		Name:        "ha",
		Description: "Create spare machines that increases app availability",
		Default:     true,
	},
	flag.Bool{
		Name:        "smoke-checks",
		Description: "Perform smoke checks during deployment",
		Default:     true,
	},
	flag.Bool{
		Name:        "no-public-ips",
		Description: "Do not allocate any new public IP addresses",
	},
	flag.Int{
		Name:        "vm-cpus",
		Description: "Number of CPUs",
		Aliases:     []string{"cpus"},
	},
	flag.String{
		Name:        "vm-cpukind",
		Description: "The kind of CPU to use ('shared' or 'performance')",
	},
	flag.Int{
		Name:        "vm-memory",
		Description: "Memory (in megabytes) to attribute to the VM",
		Aliases:     []string{"memory"},
	},
	flag.Bool{
		Name: "strategy-batch",
		Description: fmt.Sprintf(
			"For \"rolling\" and \"canary\": batch Machine updates into %d groups when updating more than %d.",
			batchingGroupCount,
			batchingCutoff,
		),
		Default: true,
	},
}

Functions

func BlueGreenStrategy added in v0.1.40

func BlueGreenStrategy(md *machineDeployment, blueMachines []*machineUpdateEntry) *blueGreen

func DeployWithConfig added in v0.0.337

func DeployWithConfig(ctx context.Context, appConfig *appconfig.Config, forceYes bool) (err error)

func New

func New() (cmd *cobra.Command)

Types

type MachineDeployment added in v0.0.452

type MachineDeployment interface {
	DeployMachinesApp(context.Context) error
}

func NewMachineDeployment added in v0.0.452

func NewMachineDeployment(ctx context.Context, args MachineDeploymentArgs) (MachineDeployment, error)

type MachineDeploymentArgs added in v0.0.452

type MachineDeploymentArgs struct {
	AppCompact            *api.AppCompact
	DeploymentImage       string
	Strategy              string
	BatchMachineWaits     bool
	EnvFromFlags          []string
	PrimaryRegionFlag     string
	SkipSmokeChecks       bool
	SkipHealthChecks      bool
	RestartOnly           bool
	WaitTimeout           time.Duration
	LeaseTimeout          time.Duration
	ReleaseCmdTimeout     time.Duration
	VMSize                string
	VMCPUs                int
	VMMemory              int
	VMCPUKind             string
	IncreasedAvailability bool
	AllocPublicIP         bool
}

type ProcessGroupsDiff added in v0.0.490

type ProcessGroupsDiff struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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