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

package environments

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

Index

Package Files

devenv.go gitops.go

func AddAppMetaData Uses

func AddAppMetaData(chartDir string, app *jenkinsv1.App, repository string) error

AddAppMetaData applies chart metadata to an App resource

func CreateNestedRequirementDir Uses

func CreateNestedRequirementDir(dir string, requirementName string, requirementDir string, requirementVersion string,
    requirementRepository string, verbose bool, requirementValuesFiles *ValuesFiles, helmer helm.Helmer) error

CreateNestedRequirementDir creates the a directory for a chart being added as a requirement, adding a README.md, the release.yaml, and the values.yaml. The dir is the unpacked chart directory to which the requirement is being added. The requirementName, requirementVersion, requirementRepository and requirementValuesFiles are used to construct the metadata, as well as info in the requirementDir which points to the unpacked chart of the requirement.

func EnhanceChartWithAppMetadata Uses

func EnhanceChartWithAppMetadata(chartDir string, app *jenkinsv1.App, repository string, outputDir string,
    filename string) error

EnhanceChartWithAppMetadata will update the app in chartDir with app metadata, writing the custom resource to the outputDir as a new file called filename

func LocateAppResource Uses

func LocateAppResource(helmer helm.Helmer, chartDir string, appName string) (*jenkinsv1.App,
    string, error)

LocateAppResource finds or creates a resource of Kind: App in a given appName rooted in chartDir, writing it to outputDir. The template with the

func ModifyChartFiles Uses

func ModifyChartFiles(dir string, details *gits.PullRequestDetails, modifyFn ModifyChartFn, chartName string) error

ModifyChartFiles modifies the chart files in the given directory using the given modify function

func ModifyDevEnvironmentWithNs Uses

func ModifyDevEnvironmentWithNs(jxClient versioned.Interface, ns string,
    fn func(env *v1.Environment) error) error

ModifyDevEnvironment performs some mutation on the Development environment to modify team settings

type EnvironmentPullRequestOptions Uses

type EnvironmentPullRequestOptions struct {
    Gitter        gits.Gitter
    GitProvider   gits.GitProvider
    ModifyChartFn ModifyChartFn
    Labels        []string
}

EnvironmentPullRequestOptions are options for creating a pull request against an environment. The provide a Gitter client for performing git operations, a GitProvider client for talking to the git provider, a callback ModifyChartFn which is where the changes you want to make are defined,

func (*EnvironmentPullRequestOptions) Create Uses

func (o *EnvironmentPullRequestOptions) Create(env *jenkinsv1.Environment, environmentsDir string,
    pullRequestDetails *gits.PullRequestDetails, filter *gits.PullRequestFilter, chartName string, autoMerge bool) (*gits.PullRequestInfo, error)

Create a pull request against the environment repository for env. The EnvironmentPullRequestOptions are used to provide a Gitter client for performing git operations, a GitProvider client for talking to the git provider, a callback ModifyChartFn which is where the changes you want to make are defined. The branchNameText defines the branch name used, the title is used for both the commit and the pull request title, the message as the body for both the commit and the pull request, and the pullRequestInfo for any existing PR that exists to modify the environment that we want to merge these changes into.

type ModifyChartFn Uses

type ModifyChartFn func(requirements *helm.Requirements, metadata *chart.Metadata, existingValues map[string]interface{},
    templates map[string]string, dir string, pullRequestDetails *gits.PullRequestDetails) error

ModifyChartFn callback for modifying a chart, requirements, the chart metadata, the values.yaml and all files in templates are unmarshaled, and the root dir for the chart is passed

func CreateAddRequirementFn Uses

func CreateAddRequirementFn(chartName string, alias string, version string, repo string,
    valuesFiles *ValuesFiles, chartDir string, verbose bool, helmer helm.Helmer) ModifyChartFn

CreateAddRequirementFn create the ModifyChartFn that adds a dependency to a chart. It takes the chart name, an alias for the chart, the version of the chart, the repo to load the chart from, valuesFiles (an array of paths to values.yaml files to add). The chartDir is the unpacked chart being added, which is used to add extra metadata about the chart (e.g. the charts readme, the release.yaml, the git repo url and the release notes) - if this points to a non-existent directory it will be ignored.

func CreateUpgradeRequirementsFn Uses

func CreateUpgradeRequirementsFn(all bool, chartName string, alias string, version string, username string,
    password string, helmer helm.Helmer, inspectChartFunc func(chartDir string,
        existingValues map[string]interface{}) error, verbose bool, valuesFiles *ValuesFiles) ModifyChartFn

CreateUpgradeRequirementsFn creates the ModifyChartFn that upgrades the requirements of a chart. Either all requirements may be upgraded, or the chartName, alias and version can be specified. A username and password can be passed for a protected repository. The passed inspectChartFunc will be called whilst the chart for each requirement is unpacked on the disk. Operations are carried out using the helmer interface and there will be more logging if verbose is true. The passed valuesFiles are used to add a values.yaml to each requirement.

type ValuesFiles Uses

type ValuesFiles struct {
    Items []string
}

ValuesFiles is a wrapper for a slice of values files to allow them to be passed around as a pointer

Package environments imports 18 packages (graph) and is imported by 7 packages. Updated 2019-11-14. Refresh now. Tools for package owners.