jx: github.com/jenkins-x/jx/pkg/apps Index | Files

package apps

import "github.com/jenkins-x/jx/pkg/apps"

Index

Package Files

constants.go gitops.go helmops.go install.go values.go

Constants

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

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

Variables

var AllTypes = []AppType{
    Controller,
    PipelineExtension,
}

AllTypes exposes all App types in a slice

func AddValuesToChart Uses

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

AddValuesToChart adds a values file to the chart rooted at dir

func GenerateQuestions Uses

func GenerateQuestions(schema []byte, batchMode bool, askExisting bool, basePath string, secretURLClient secreturl.Client,
    existing map[string]interface{}, vaultScheme string, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) ([]byte, error)

GenerateQuestions asks questions based on the schema

func ProcessValues Uses

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,
    in terminal.FileReader,
    out terminal.FileWriter,
    outErr io.Writer,
    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 Uses

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

type AppType Uses

type AppType uint32

AppType defines the type of the App

func (AppType) String Uses

func (a AppType) String() string

String returns a string representation of the App type

type ChartDetails Uses

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

ChartDetails are details about a chart returned by the chart interrogator

type GitOpsOptions Uses

type GitOpsOptions struct {
    *InstallOptions
}

GitOpsOptions is the options used for Git Operations for apps

func (*GitOpsOptions) AddApp Uses

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 Uses

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

DeleteApp deletes the app with alias

func (*GitOpsOptions) GetApps Uses

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 Uses

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 Uses

type HelmOpsOptions struct {
    *InstallOptions
}

HelmOpsOptions is the options used for Helm Operations for apps

func (*HelmOpsOptions) AddApp Uses

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 Uses

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 Uses

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 Uses

type InstallOptions struct {
    Helmer          helm.Helmer
    KubeClient      kubernetes.Interface
    InstallTimeout  string
    JxClient        versioned.Interface
    Namespace       string
    EnvironmentsDir string
    GitProvider     gits.GitProvider
    Gitter          gits.Gitter
    Verbose         bool
    DevEnv          *jenkinsv1.Environment
    BatchMode       bool
    In              terminal.FileReader
    Out             terminal.FileWriter
    Err             io.Writer
    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 Uses

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 Uses

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 Uses

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

GetApps gets a list of installed apps

func (*InstallOptions) UpgradeApp Uses

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

Package apps imports 30 packages (graph) and is imported by 6 packages. Updated 2019-09-01. Refresh now. Tools for package owners.