operations

package
v2.0.400-0...-14731b4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDependencyMatrixUpdatePaths

func AddDependencyMatrixUpdatePaths(upstreamDependencyAsset *gits.GitReleaseAsset, updateDependency *v1.DependencyUpdate) ([]*v1.DependencyUpdate, error)

AddDependencyMatrixUpdatePaths retrieves the upstreamDependencyAsset and converts it to a slice of DependencyUpdates, prepending the updateDependency to the path

Types

type ChangeFilesFn

type ChangeFilesFn func(dir string, gitInfo *gits.GitRepository) ([]string, error)

ChangeFilesFn is the function called to create the pull request

func CreateChartChangeFilesFn

func CreateChartChangeFilesFn(name string, version string, kind string, pro *PullRequestOperation, helmer helm.Helmer,
	vaultClient secreturl.Client, handles util.IOFileHandles) ChangeFilesFn

CreateChartChangeFilesFn creates the ChangeFilesFn for updating the chart with name to version. If the version is empty it will fetch the latest version using helmer, using the vaultClient to get the repo creds or prompting using in, out and outErr

func CreatePullRequestBuildersFn

func CreatePullRequestBuildersFn(version string) ChangeFilesFn

CreatePullRequestBuildersFn creates the ChangeFilesFn that will update the gcr.io/jenkinsxio/builder-*.yml images

func CreatePullRequestMLBuildersFn

func CreatePullRequestMLBuildersFn(version string) ChangeFilesFn

CreatePullRequestMLBuildersFn creates the ChangeFilesFn that will update the gcr.io/jenkinsxio/builder-machine-learning*.yml images

func CreatePullRequestRegexFn

func CreatePullRequestRegexFn(version string, regex string, files ...string) (ChangeFilesFn, error)

CreatePullRequestRegexFn creates the ChangeFilesFn that will apply the regex, updating the matches to version over the files

type PullRequestOperation

type PullRequestOperation struct {
	*opts.CommonOptions
	GitURLs       []string
	SrcGitURL     string
	Base          string
	Component     string
	BranchName    string
	Version       string
	DryRun        bool
	SkipCommit    bool
	AuthorName    string
	AuthorEmail   string
	SkipAutoMerge bool
	Labels        []string
}

PullRequestOperation provides a way to execute a PullRequest operation using Git

func (PullRequestOperation) CreateDependencyUpdatePRDetails

func (o PullRequestOperation) CreateDependencyUpdatePRDetails(kind string, srcRepoURL string, destHost string, fromVersion string, toVersion string, component string) (string, *gits.PullRequestDetails, *v1.DependencyUpdate, []gits.GitReleaseAsset, error)

CreateDependencyUpdatePRDetails creates the PullRequestDetails for a pull request, taking the kind of change it is (an id) the srcRepoUrl for the repo that caused the change, the destRepo for the repo receiving the change, the fromVersion and the toVersion

func (*PullRequestOperation) CreatePullRequest

func (o *PullRequestOperation) CreatePullRequest(kind string, update ChangeFilesFn) (*gits.PullRequestInfo, error)

CreatePullRequest will fork (if needed) and pull a git repo, then perform the update, and finally create or update a PR for the change. Any open PR on the repo with the `updatebot` label will be updated.

func (*PullRequestOperation) CreatePullRequestGitReleasesFn

func (o *PullRequestOperation) CreatePullRequestGitReleasesFn(name string) ChangeFilesFn

CreatePullRequestGitReleasesFn creates the ChangeFilesFn that will update the git/ directory in the versions repo, using the git provider release api

func (*PullRequestOperation) WrapChangeFilesWithCommitFn

func (o *PullRequestOperation) WrapChangeFilesWithCommitFn(kind string, fn ChangeFilesFn) ChangeFilesFn

WrapChangeFilesWithCommitFn wraps the passed ChangeFilesFn in a commit. This is useful for creating multiple commits to batch e.g. in a single PR push/creation

Jump to

Keyboard shortcuts

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