apps

package
v2.1.146 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppPodTemplateName the name of the pod template to store default settings for pods executing an App extension step
	AppPodTemplateName = "app-extension"

	// AppTypeLabel label used to store the app type in the App CRD.
	AppTypeLabel = "jenkins.io/app-type"

	// Controller is an App type which installs a controller into the cluster.
	Controller AppType = iota

	// PipelineExtension is an App type which wants to modify the build pipeline by being executed as part of the meta pipeline.
	PipelineExtension
)

These are the different App types

View Source
const (
	//ValuesAnnotation is the name of the annotation used to stash values
	ValuesAnnotation = "jenkins.io/values.yaml"
)

Variables

AllTypes exposes all App types in a slice

Functions

func AddValuesToChart

func AddValuesToChart(name string, values []byte, verbose bool) (string, func(), error)

AddValuesToChart adds a values file to the chart rooted at dir

func GenerateQuestions

func GenerateQuestions(schema []byte, batchMode bool, askExisting bool, basePath string, secretURLClient secreturl.Client,
	existing map[string]interface{}, vaultScheme string, handles util.IOFileHandles) ([]byte, error)

GenerateQuestions asks questions based on the schema

func ProcessValues

func ProcessValues(
	schema []byte,
	name string,
	gitOpsURL string,
	teamName string,
	basePath string,
	batchMode bool,
	askExisting bool,
	secretURLClient secreturl.Client,
	existing map[string]interface{},
	vaultScheme string,
	handles util.IOFileHandles,
	verbose bool) (string, func(), error)

ProcessValues is responsible for taking a schema, asking questions of the user (using in, out and outErr), and generating a yaml file that contains the answers. The path to the yaml file is returned, along with a function to cleanup temporary resources, including the yaml file. The gitOpsURL, if specified, is used to determine the path to store the secrets in the vault, otherwise the team name is used. If batchMode is true, it alters the way questions are asked, trying to use existing answers or defaults where possible. If askExisting is true then all questions, even those with existing answers are asked. The vault client is used to store secrets, and the secretsScheme is used as the scheme part of the url to the secret.

func StashValues

func StashValues(values []byte, name string, jxClient versioned.Interface, ns string, chartDir string, repository string) (bool, *jenkinsv1.App, error)

StashValues takes the values used to configure an app and annotates the APP CRD with them allowing them to be used at a later date e.g. when the app is upgraded

Types

type AppType

type AppType uint32

AppType defines the type of the App

func (AppType) String

func (a AppType) String() string

String returns a string representation of the App type

type ChartDetails

type ChartDetails struct {
	Values  []byte
	Version string
	Name    string
	Cleanup func()
}

ChartDetails are details about a chart returned by the chart interrogator

type GitOpsOptions

type GitOpsOptions struct {
	*InstallOptions
}

GitOpsOptions is the options used for Git Operations for apps

func (*GitOpsOptions) AddApp

func (o *GitOpsOptions) AddApp(app string, dir string, version string, repository string, alias string, autoMerge bool) error

AddApp adds the app with version rooted in dir from the repository. An alias can be specified.

func (*GitOpsOptions) DeleteApp

func (o *GitOpsOptions) DeleteApp(app string, alias string, autoMerge bool) error

DeleteApp deletes the app with alias

func (*GitOpsOptions) GetApps

func (o *GitOpsOptions) GetApps(appNames map[string]bool, expandFn func([]string) (*v1.AppList, error)) (*v1.AppList, error)

GetApps retrieves all the apps information for the given appNames from the repository and / or the CRD API

func (*GitOpsOptions) UpgradeApp

func (o *GitOpsOptions) UpgradeApp(app string, version string, repository string, username string, password string,
	alias string, interrogateChartFunc func(dir string, existing map[string]interface{}) (*ChartDetails,
		error), autoMerge bool) error

UpgradeApp upgrades the app (or all apps if empty) to a version ( or latest if empty) from a repository with username and password. If one app is being upgraded an alias can be specified.

type HelmOpsOptions

type HelmOpsOptions struct {
	*InstallOptions
}

HelmOpsOptions is the options used for Helm Operations for apps

func (*HelmOpsOptions) AddApp

func (o *HelmOpsOptions) AddApp(app string, chart string, name string, version string, values []byte, repository string,
	username string, password string, releaseName string, setValues []string, helmUpdate bool) error

AddApp adds the app with a version and releaseName from the chart from the repository with username and password. A values file or a slice of name=value pairs can be passed in to configure the chart

func (*HelmOpsOptions) DeleteApp

func (o *HelmOpsOptions) DeleteApp(app string, releaseName string, purge bool) error

DeleteApp deletes the app, optionally allowing the user to set the releaseName

func (*HelmOpsOptions) UpgradeApp

func (o *HelmOpsOptions) UpgradeApp(app string, version string, repository string, username string, password string,
	releaseName string, alias string, helmUpdate bool) error

UpgradeApp upgrades the app with releaseName (or all apps if the app name is empty) to the specified version ( or the latest version if the version is empty) using the repository with username and password

type InstallOptions

type InstallOptions struct {
	Helmer              helm.Helmer
	KubeClient          kubernetes.Interface
	InstallTimeout      string
	JxClient            versioned.Interface
	Namespace           string
	EnvironmentCloneDir string
	GitProvider         gits.GitProvider
	Gitter              gits.Gitter
	Verbose             bool
	DevEnv              *jenkinsv1.Environment
	BatchMode           bool
	IOFileHandles       util.IOFileHandles
	GitOps              bool
	TeamName            string
	BasePath            string
	VaultClient         vault.Client
	AutoMerge           bool
	SecretsScheme       string
	// contains filtered or unexported fields
}

InstallOptions are shared options for installing, removing or upgrading apps for either GitOps or HelmOps

func (*InstallOptions) AddApp

func (o *InstallOptions) AddApp(app string, version string, repository string, username string, password string,
	releaseName string, valuesFiles []string, setValues []string, alias string, helmUpdate bool) error

AddApp adds the app at a particular version ( or latest if not specified) from the repository with username and password. A releaseName can be specified. Values can be passed with in files or as a slice of name=value pairs. An alias can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag

func (*InstallOptions) DeleteApp

func (o *InstallOptions) DeleteApp(app string, alias string, releaseName string, purge bool) error

DeleteApp deletes the app. An alias and releaseName can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag

func (*InstallOptions) GetApps

func (o *InstallOptions) GetApps(appNames []string) (apps *jenkinsv1.AppList, err error)

GetApps gets a list of installed apps

func (*InstallOptions) UpgradeApp

func (o *InstallOptions) UpgradeApp(app string, version string, repository string, username string, password string,
	releaseName string, alias string, update bool, askExisting bool) error

UpgradeApp upgrades the app (or all apps if empty) to a particular version ( or the latest if not specified) from the repository with username and password. An alias can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag

Jump to

Keyboard shortcuts

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