deploy

package
v0.11.15 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command *cli.Command = &cli.Command{
	Name:    "deploy",
	Aliases: []string{"d"},
	Usage:   "Deploy the project",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:     "system-name",
			Aliases:  []string{"s"},
			Usage:    "The system name to use",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "helm-values-file",
			Aliases:  []string{"f"},
			Usage:    "The helm values file to use",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "image-tag",
			Aliases:  []string{"i"},
			Usage:    "The image tag to deploy",
			Required: true,
		},
		&cli.StringFlag{
			Name:    "environment",
			Aliases: []string{"e"},
			Usage:   "The environment to deploy to",
			Value:   "dev",
			Action: func(c *cli.Context, environment string) error {
				allowedEnvironments := []string{"sandbox", "dev", "test", "prod"}
				if !slices.Contains(allowedEnvironments, environment) {
					return cli.Exit(fmt.Sprintf("Invalid environment provided: must be one of %v", allowedEnvironments), 1)
				}

				return nil
			},
		},
		&cli.StringFlag{
			Name:    "workload-type",
			Aliases: []string{"w"},
			Usage:   "The workload type to use",
			Value:   "deployment",
			Action: func(c *cli.Context, workloadType string) error {
				allowedWorkloadTypes := []string{"deployment", "statefulset"}
				if !slices.Contains(allowedWorkloadTypes, workloadType) {
					return cli.Exit(fmt.Sprintf("Invalid workload type provided: must be one of %v", allowedWorkloadTypes), 1)
				}

				return nil
			},
		},
		&cli.StringFlag{
			Name:    "runtime-cloud-provider",
			Aliases: []string{"r"},
			Usage:   "The runtime cloud provider to use",
			Value:   "aks",
			Action: func(c *cli.Context, runtimeCloudProvider string) error {
				allowedRuntimeCloudProviders := []string{"aks", "gke"}
				if !slices.Contains(allowedRuntimeCloudProviders, strings.ToLower(runtimeCloudProvider)) {
					return cli.Exit(
						fmt.Sprintf(
							"Invalid runtime cloud provider '%s' provided: must be one of %v (ignoring case)",
							runtimeCloudProvider,
							allowedRuntimeCloudProviders),
						1,
					)
				}

				return nil
			},
		},
		&cli.StringFlag{
			Name:    "commit-hash",
			Aliases: []string{"c"},
			Usage:   "The commit hash to use",
		},
		&cli.StringFlag{
			Name:    "repository-name",
			Aliases: []string{"n"},
			Usage:   "The repository name to use",
		},
		&cli.BoolFlag{
			Name:    "skip-authentication",
			Aliases: []string{"A"},
			Usage:   "Skips authentication against the runtime cloud provider",
		},
		&cli.BoolFlag{
			Name:    "dry-run",
			Aliases: []string{"D"},
			Usage:   "Simulate the deployment without actually deploying.",
		},
		&cli.StringFlag{
			Name:   "aks-tenant-id",
			Usage:  "The AKS tenant ID to use",
			Hidden: true,
		},
		&cli.StringFlag{
			Name:   "aks-subscription-id",
			Usage:  "The AKS subscription ID to use",
			Hidden: true,
		},
		&cli.StringFlag{
			Name:   "aks-cluster-name",
			Usage:  "The AKS cluster name to use",
			Hidden: true,
		},
		&cli.StringFlag{
			Name:   "aks-resource-group-name",
			Usage:  "The AKS resource group name to use",
			Hidden: true,
		},
		&cli.StringFlag{
			Name:    "gke-project-id",
			Usage:   "The GKE project ID to use",
			Hidden:  true,
			EnvVars: []string{"3LV_GKE_PROJECT_ID"},
		},
		&cli.StringFlag{
			Name:    "gke-cluster-name",
			Usage:   "The GKE cluster name to use",
			Hidden:  true,
			EnvVars: []string{"3LV_GKE_CLUSTER_NAME"},
		},
		&cli.StringFlag{
			Name:    "gke-cluster-location",
			Usage:   "The GKE cluster location to use",
			Hidden:  true,
			EnvVars: []string{"3LV_GKE_CLUSTER_LOCATION"},
		},
	},
	Action: Deploy,
}

Functions

func Deploy

func Deploy(c *cli.Context) error

Types

type AuthenticateAKSOptions added in v0.10.0

type AuthenticateAKSOptions struct {
	AKSTenantID string
}

type GetGKECredentialsOptions added in v0.11.4

type GetGKECredentialsOptions struct {
	GKEProjectID       string
	GKEClusterName     string
	GKEClusterLocation string
}

type SetupAKSOptions added in v0.11.4

type SetupAKSOptions struct {
	AKSTenantID          string
	AKSSubscriptionID    string
	AKSClusterName       string
	AKSResourceGroupName string
}

type SetupGKEOptions added in v0.11.4

type SetupGKEOptions struct {
	GKEProjectID       string
	GKEClusterName     string
	GKEClusterLocation string
}

Jump to

Keyboard shortcuts

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