Documentation ¶
Index ¶
- Constants
- func GenerateBuild(fs afero.Fs, outputFolder string, component appstudiov1alpha1.Component, ...) error
- func GeneratePACRepository(component appstudiov1alpha1.Component, config map[string][]byte) (*pacv1alpha1.Repository, error)
- func GenerateTektonBuild(outputPath string, component appstudiov1alpha1.Component, appFs afero.Afero, ...) error
- func GetGitProvider(component appstudiov1alpha1.Component) (string, error)
- func GetProviderTokenKey(gitProvider string) string
- func GetWebhookSecretKeyForComponent(component appstudiov1alpha1.Component) string
- func IsPaCApplicationConfigured(gitProvider string, config map[string][]byte) bool
- type MockGenerator
- func (m *MockGenerator) CloneGenerateAndPush(outputPath string, remote string, options gitopsv1alpha1.GeneratorOptions, ...) error
- func (m *MockGenerator) CloneRepo(outputPath string, remote string, componentName string, branch string) error
- func (m *MockGenerator) CommitAndPush(outputPath string, repoPathOverride string, remote string, ...) error
- func (m *MockGenerator) GenerateAndPush(outputPath string, remote string, options gitopsv1alpha1.GeneratorOptions, ...) error
- func (m *MockGenerator) GenerateOverlaysAndPush(outputPath string, clone bool, remote string, ...) error
- func (m *MockGenerator) GetCommitIDFromRepo(fs afero.Afero, repoPath string) (string, error)
- func (m *MockGenerator) GitRemoveComponent(outputPath string, remote string, componentName string, branch string, ...) error
- func (m *MockGenerator) RemoveComponent(outputPath string, componentName string, context string) error
Constants ¶
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 ¶
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
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 (*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