gitops

package
v0.0.0-...-2118818 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvmanExport

func EnvmanExport(name, value string) error

EnvmanExport exports an environment variable using envman.

func NewConfig

func NewConfig() (config, error)

NewConfig returns a new configuration initialized from environment variables.

func NewGitRepo

func NewGitRepo(ctx context.Context, p NewGitRepoParams) (*gitRepo, error)

NewGitRepo returns a new local clone of a remote repository. It should be closed after usage.

func NewGithubClient

func NewGithubClient(ctx context.Context, repo *githubRepo) (*githubClient, error)

NewGithubClient returns a new Github client to interact with a given repository.

func NewGithubRepo

func NewGithubRepo(url, user string, token stepconf.Secret) (*githubRepo, error)

NewGithubRepo return a new Github repository.

Types

type Integration

type Integration struct {
	// Repo is local clone of remote repository.
	Repo localRepository
	// ExportEnv is an environment variable exporter.
	ExportEnv envExporter
	// Renderer renders templates to a given repository.
	Renderer allFilesRenderer
}

Integration is a GitOps integration for Bitrise CI.

func (Integration) UpdateFiles

func (i Integration) UpdateFiles(ctx context.Context, p UpdateFilesParams) error

UpdateFiles updates files in a GitOps repository. It either pushes changes to the given branch directly or opens a pull request for manual approval. URL of the pull request is exported to the PR_URL environment variable in the latter case.

type NewGitRepoParams

type NewGitRepoParams struct {
	PullRequestOpener pullRequestOpener
	GithubRepo        *githubRepo
	Branch            string
}

NewGitRepoParams are parameters for NewGitRepo function.

type Templates

type Templates struct {
	// Source folder of templates.
	SourceFolder string
	// Values to substitute into the templates.
	Values map[string]string
	// Destination repository for rendered files.
	DestinationRepo localRepository
	// Destination folder inside the repository for rendered files.
	DestinationFolder string
}

Templates renders a folder of templates to a local repository.

type UpdateFilesParams

type UpdateFilesParams struct {
	// PullRequest won't push to the branch. It will open a PR only instead.
	PullRequest bool
	// PullRequestTitle is the title of the opened pull request.
	PullRequestTitle string
	// PullRequestBody is the body of the opened pull request.
	PullRequestBody string
	// CommitMessage is the created commit's message.
	CommitMessage string
}

UpdateFilesParams are parameters for UpdateFiles function.

Jump to

Keyboard shortcuts

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