stack

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BootstrapCmd = cli.Command{
	Name:      "bootstrap",
	Usage:     "Bootstraps the gitops controller",
	UsageText: `stack bootstrap --single-env --gitops-repo-url git@github.com:<user>/<repo>.git`,
	Action:    gitops.Bootstrap,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "env",
			Usage: "environment to bootstrap",
		},
		&cli.BoolFlag{
			Name:  "single-env",
			Usage: "if the repo holds manifests from a single environment",
		},
		&cli.StringFlag{
			Name:     "gitops-repo-url",
			Usage:    "URL of the gitops repo (mandatory)",
			Required: true,
		},
		&cli.StringFlag{
			Name:  "gitops-repo-path",
			Usage: "path to the working copy of the gitops repo, default: current dir",
		},
		&cli.BoolFlag{
			Name:  "no-controller",
			Usage: "to not bootstrap the FluxV2 gitops controller, only the GitRepository and Kustomization to add a new source",
		},
	},
}
View Source
var Command = cli.Command{
	Name:  "stack",
	Usage: "Bootstrap curated Kubernetes stacks",
	Subcommands: []*cli.Command{
		&GenerateCmd,
		&ConfigureCmd,
		&LintCmd,
		&UpdateCmd,
	},
}
View Source
var ConfigureCmd = cli.Command{
	Name:      "configure",
	Usage:     "Configures Kubernetes resources and writes a stack.yaml",
	UsageText: `stack configure`,
	Action:    configure,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "config",
			Aliases: []string{"c"},
		},
		&cli.StringFlag{
			Name:    "stack-repo",
			Aliases: []string{"r"},
		},
		&cli.StringFlag{
			Name: "stack-definition",
		},
	},
}
View Source
var GenerateCmd = cli.Command{
	Name:      "generate",
	Usage:     "Generates Kubernetes resources from stack.yaml",
	UsageText: `stack generate`,
	Action:    generateFunc,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "config",
			Aliases: []string{"c"},
		},
	},
}
View Source
var LintCmd = cli.Command{
	Name:      "lint",
	Usage:     "Lints the stack.yaml file",
	UsageText: `stack lint`,
	Action:    lint,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "config",
			Aliases: []string{"c"},
			Usage:   "stack.yaml to lint",
		},
	},
}
View Source
var UpdateCmd = cli.Command{
	Name:      "update",
	Usage:     "Updates the stack version in stack.yaml",
	UsageText: `stack update`,
	Action:    update,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "config",
			Aliases: []string{"c"},
		},
		&cli.BoolFlag{
			Name: "check",
		},
		&cli.StringFlag{
			Name:    "output",
			Aliases: []string{"o"},
			Usage:   "output format, eg.: json",
		},
	},
}

Functions

func CurrentVersion

func CurrentVersion(repoURL string) string

func GenerateFromStackYaml

func GenerateFromStackYaml(stackConfig StackConfig) (map[string]string, error)

func IsVersionLocked

func IsVersionLocked(stackConfig StackConfig) (bool, error)

func LatestVersion

func LatestVersion(repoURL string) (string, error)

func RepoUrlWithoutVersion

func RepoUrlWithoutVersion(repoURL string) string

func StackDefinitionFromRepo

func StackDefinitionFromRepo(repoUrl string) (string, error)

func VersionsSince

func VersionsSince(repoURL string, sinceString string) ([]string, error)

Types

type Component

type Component struct {
	Name        string `json:"name,omitempty" yaml:"name"`
	Description string `json:"description,omitempty" yaml:"description"`
	Category    string `json:"category,omitempty" yaml:"category"`
	Variable    string `json:"variable,omitempty" yaml:"variable"`
	OnePager    string `json:"onePager,omitempty" yaml:"onePager"`
	Schema      string `json:"schema,omitempty" yaml:"schema"`
	UISchema    string `json:"uiSchema,omitempty" yaml:"uiSchema"`
}

type StackConfig

type StackConfig struct {
	Stack  StackRef               `yaml:"stack" json:"stack"`
	Config map[string]interface{} `yaml:"config" json:"config"`
}

func Configure

func Configure(stackDefinition StackDefinition, existingStackConfig StackConfig) (StackConfig, bool, error)

type StackDefinition

type StackDefinition struct {
	Name        string        `json:"name,omitempty" yaml:"name"`
	Description string        `json:"description,omitempty" yaml:"description"`
	Intro       string        `json:"intro,omitempty" yaml:"intro"`
	Categories  []interface{} `json:"categories" yaml:"categories"`
	Components  []*Component  `json:"components,omitempty" yaml:"components"`
	ChangLog    string        `json:"changeLog,omitempty" yaml:"changeLog"`
	Message     string        `json:"message,omitempty" yaml:"message"`
}

type StackRef

type StackRef struct {
	Repository string `yaml:"repository" json:"repository"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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