gitops

package
v0.0.0-...-50752a0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PaCAnnotation                     = "pipelinesascode"
	GitProviderAnnotationName         = "git-provider"
	GitProviderAnnotationURL          = "git-provider-url"
	PipelinesAsCodeWebhooksSecretName = "pipelines-as-code-webhooks-secret"
	PipelinesAsCode_githubAppIdKey    = "github-application-id"
	PipelinesAsCode_githubPrivateKey  = "github-private-key"
)

Variables

This section is empty.

Functions

func GenerateBuild

func GenerateBuild(fs afero.Fs, outputFolder string, component appstudiov1alpha1.Component, gitopsConfig gitopsprepare.GitopsConfig) error

func GeneratePACRepository

func GeneratePACRepository(component appstudiov1alpha1.Component, config map[string][]byte) (*pacv1alpha1.Repository, error)

GeneratePACRepository creates configuration of Pipelines as Code repository object.

func GenerateTektonBuild

func GenerateTektonBuild(outputPath string, component appstudiov1alpha1.Component, appFs afero.Afero, context string, gitopsConfig prepare.GitopsConfig) error

GenerateTektonBuild writes a set of YAML configuration files into outputPath for the component.

func GetGitProvider

func GetGitProvider(component appstudiov1alpha1.Component) (string, error)

GetGitProvider returns git provider name based on the repository url, e.g. github, gitlab, etc or git-privider annotation

func GetProviderTokenKey

func GetProviderTokenKey(gitProvider string) string

GetProviderTokenKey returns key (field name) of the given provider access token in the Pipelines as Code k8s secret

func GetWebhookSecretKeyForComponent

func GetWebhookSecretKeyForComponent(component appstudiov1alpha1.Component) string

func IsPaCApplicationConfigured

func IsPaCApplicationConfigured(gitProvider string, config map[string][]byte) bool

IsPaCApplicationConfigured checks if Pipelines as Code credentials configured for given provider. Application is preffered over webhook if possible.

Types

type MockGenerator

type MockGenerator struct {
	Outputs  *testutils.OutputStack
	Errors   *testutils.ErrorStack
	Executed []testutils.Execution
}

func NewMockGenerator

func NewMockGenerator(outputs ...[]byte) *MockGenerator

func (*MockGenerator) CloneGenerateAndPush

func (m *MockGenerator) CloneGenerateAndPush(outputPath string, remote string, options gitopsv1alpha1.GeneratorOptions, appFs afero.Afero, branch string, context string, doPush bool) error

CloneGenerateAndPush succeeds if there's no errors in the errorStack, fails otherwise

func (*MockGenerator) CloneRepo

func (m *MockGenerator) CloneRepo(outputPath string, remote string, componentName string, branch string) error

CloneRepo is not called by any tests

func (*MockGenerator) CommitAndPush

func (m *MockGenerator) CommitAndPush(outputPath string, repoPathOverride string, remote string, componentName string, branch string, commitMessage string) error

CommitAndPush always succeeds

func (*MockGenerator) GenerateAndPush

func (m *MockGenerator) GenerateAndPush(outputPath string, remote string, options gitopsv1alpha1.GeneratorOptions, appFs afero.Afero, branch string, doPush bool, createdBy string) error

GenerateAndPush is not called by any tests

func (*MockGenerator) GenerateOverlaysAndPush

func (m *MockGenerator) GenerateOverlaysAndPush(outputPath string, clone bool, remote string, options gitopsv1alpha1.GeneratorOptions, applicationName, environmentName, imageName, namespace string, appFs afero.Afero, branch string, context string, doPush bool, componentGeneratedResources map[string][]string) error

GenerateOverlaysAndPush is a simplified version of the real method. It's intended to invoke a pass/fail response from GenerateOverlays and nothing else

func (*MockGenerator) GetCommitIDFromRepo

func (m *MockGenerator) GetCommitIDFromRepo(fs afero.Afero, repoPath string) (string, error)

func (*MockGenerator) GitRemoveComponent

func (m *MockGenerator) GitRemoveComponent(outputPath string, remote string, componentName string, branch string, context string) error

GitRemoveComponent is not called by any tests

func (*MockGenerator) RemoveComponent

func (m *MockGenerator) RemoveComponent(outputPath string, componentName string, context string) error

RemoveComponent is not called by any tests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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