Documentation ¶
Index ¶
- Constants
- Variables
- type CommitInfo
- type CommitMetadata
- type FileSystemYamlWriter
- type GitProvider
- type InteractivePromptProvider
- func (*InteractivePromptProvider) ConfirmAutoMergePullRequest() (answer bool, err error)
- func (i *InteractivePromptProvider) ConfirmCreatingPromotionPullRequest(autoMerge, draft bool) (bool, error)
- func (i *InteractivePromptProvider) PrintBranchCreated(branchName, message string)
- func (i *InteractivePromptProvider) PrintCanceled()
- func (i *InteractivePromptProvider) PrintCompleted()
- func (i *InteractivePromptProvider) PrintDraftPullRequestCreated(url string)
- func (i *InteractivePromptProvider) PrintEndPreview()
- func (i *InteractivePromptProvider) PrintNoPromotableEnvironmentFound(environmentsFiltered bool)
- func (i *InteractivePromptProvider) PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, ...)
- func (i *InteractivePromptProvider) PrintPullRequestCreated(url string)
- func (i *InteractivePromptProvider) PrintReleasePreview(targetEnvName string, releaseName string, ...) error
- func (i *InteractivePromptProvider) PrintSelectedNonPromotableReleases(invalidReleases, targetEnvName string)
- func (i *InteractivePromptProvider) PrintSelectedReleasesAlreadyInSync()
- func (i *InteractivePromptProvider) PrintStartPreview()
- func (i *InteractivePromptProvider) PrintUpdatingTargetRelease(targetEnvName, releaseName, releaseFilePath string, isCreating bool)
- func (i *InteractivePromptProvider) SelectCreatingPromotionPullRequest() (string, error)
- func (i *InteractivePromptProvider) SelectReleases(list *cross.ReleaseList) (*cross.ReleaseList, error)
- func (i *InteractivePromptProvider) SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)
- func (i *InteractivePromptProvider) SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)
- type Opts
- type PerformOpts
- type Promotion
- type PromotionInfo
- type PromptProvider
- type ReleaseInfo
- type ReleaseWithGitTag
- type ShellGitProvider
- type YamlWriter
Constants ¶
View Source
const ( Ready = "Ready" Draft = "Draft" Cancel = "Cancel" )
Variables ¶
View Source
var Separator = strings.Repeat("—", 80)
Functions ¶
This section is empty.
Types ¶
type CommitInfo ¶ added in v0.31.4
type CommitMetadata ¶ added in v0.31.4
func GetCommitsMetadata ¶ added in v0.31.4
func GetCommitsMetadata(dir, from, to string) ([]*CommitMetadata, error)
type FileSystemYamlWriter ¶
type FileSystemYamlWriter struct{}
type GitProvider ¶
type InteractivePromptProvider ¶
type InteractivePromptProvider struct {
// contains filtered or unexported fields
}
func (*InteractivePromptProvider) ConfirmAutoMergePullRequest ¶ added in v0.22.0
func (*InteractivePromptProvider) ConfirmAutoMergePullRequest() (answer bool, err error)
func (*InteractivePromptProvider) ConfirmCreatingPromotionPullRequest ¶
func (i *InteractivePromptProvider) ConfirmCreatingPromotionPullRequest(autoMerge, draft bool) (bool, error)
func (*InteractivePromptProvider) PrintBranchCreated ¶
func (i *InteractivePromptProvider) PrintBranchCreated(branchName, message string)
func (*InteractivePromptProvider) PrintCanceled ¶
func (i *InteractivePromptProvider) PrintCanceled()
func (*InteractivePromptProvider) PrintCompleted ¶
func (i *InteractivePromptProvider) PrintCompleted()
func (*InteractivePromptProvider) PrintDraftPullRequestCreated ¶ added in v0.26.0
func (i *InteractivePromptProvider) PrintDraftPullRequestCreated(url string)
func (*InteractivePromptProvider) PrintEndPreview ¶
func (i *InteractivePromptProvider) PrintEndPreview()
func (*InteractivePromptProvider) PrintNoPromotableEnvironmentFound ¶
func (i *InteractivePromptProvider) PrintNoPromotableEnvironmentFound(environmentsFiltered bool)
func (*InteractivePromptProvider) PrintNoPromotableReleasesFound ¶
func (i *InteractivePromptProvider) PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)
func (*InteractivePromptProvider) PrintPullRequestCreated ¶
func (i *InteractivePromptProvider) PrintPullRequestCreated(url string)
func (*InteractivePromptProvider) PrintReleasePreview ¶
func (*InteractivePromptProvider) PrintSelectedNonPromotableReleases ¶ added in v0.31.2
func (i *InteractivePromptProvider) PrintSelectedNonPromotableReleases(invalidReleases, targetEnvName string)
func (*InteractivePromptProvider) PrintSelectedReleasesAlreadyInSync ¶
func (i *InteractivePromptProvider) PrintSelectedReleasesAlreadyInSync()
func (*InteractivePromptProvider) PrintStartPreview ¶
func (i *InteractivePromptProvider) PrintStartPreview()
func (*InteractivePromptProvider) PrintUpdatingTargetRelease ¶
func (i *InteractivePromptProvider) PrintUpdatingTargetRelease(targetEnvName, releaseName, releaseFilePath string, isCreating bool)
func (*InteractivePromptProvider) SelectCreatingPromotionPullRequest ¶ added in v0.26.0
func (i *InteractivePromptProvider) SelectCreatingPromotionPullRequest() (string, error)
func (*InteractivePromptProvider) SelectReleases ¶
func (i *InteractivePromptProvider) SelectReleases(list *cross.ReleaseList) (*cross.ReleaseList, error)
func (*InteractivePromptProvider) SelectSourceEnvironment ¶
func (i *InteractivePromptProvider) SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)
func (*InteractivePromptProvider) SelectTargetEnvironment ¶
func (i *InteractivePromptProvider) SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)
type Opts ¶
type Opts struct { // Catalog contains candidate environments and releases to promote. Catalog *catalog.Catalog // SourceEnv is the source environment to promote from. SourceEnv *v1alpha1.Environment // TargetEnv is the target environment to promote to. TargetEnv *v1alpha1.Environment // Releases are the already selected releases. // If there is more than one, no need to prompt the user to select releases. Releases []string ReleasesFiltered bool // NoPrompt means that the Promote function should avoid interactive prompts at all costs. NoPrompt bool // AutoMerge indicates if PR created needs the auto-merge label AutoMerge bool // Draft indicates if PR created needs to be draft Draft bool // SelectedEnvironments is the list of environments selected by the user interactively via `joy env select`. SelectedEnvironments []*v1alpha1.Environment // DryRun indicates if the promotion should be performed in dry-run mode DryRun bool // SkipCatalogUpdate skips catalog update and dirty check in dry-run mode. Very useful // for troubleshooting and testing templates. SkipCatalogUpdate bool }
type PerformOpts ¶ added in v0.31.4
type PerformOpts struct {
// contains filtered or unexported fields
}
type Promotion ¶
type Promotion struct {
// contains filtered or unexported fields
}
func NewDefaultPromotion ¶
func NewPromotion ¶
func NewPromotion( prompt PromptProvider, gitProvider GitProvider, pullRequestProvider pr.PullRequestProvider, yamlWriter YamlWriter, commitTemplate string, pullRequestTemplate string, getProjectRepositoryFunc func(proj *v1alpha1.Project) string, getProjectSourceDirFunc func(proj *v1alpha1.Project) (string, error), getCommitsMetadataFunc func(projectDir, from, to string) ([]*CommitMetadata, error), getCommitsGitHubAuthorsFunc func(proj *v1alpha1.Project, fromTag, toTag string) (map[string]string, error), getReleaseGitTagFunc func(release *v1alpha1.Release) (string, error), ) *Promotion
type PromotionInfo ¶ added in v0.31.4
type PromotionInfo struct { SourceEnvironment *v1alpha1.Environment TargetEnvironment *v1alpha1.Environment Releases []*ReleaseInfo Error error }
type PromptProvider ¶
type PromptProvider interface { // SelectSourceEnvironment prompts user to select source environment to promote from. SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error) // SelectTargetEnvironment prompts user to select target environment to promote to. SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error) // SelectReleases prompts user to select releases to promote. SelectReleases(list *cross.ReleaseList) (*cross.ReleaseList, error) // ConfirmCreatingPromotionPullRequest prompts user to confirm whether to continue creating promotion pull request // or abort. ConfirmCreatingPromotionPullRequest(autoMerge, draft bool) (bool, error) // SelectCreatingPromotionPullRequest prompts user to select state of promotion PR // or abort. SelectCreatingPromotionPullRequest() (string, error) // ConfirmAutoMergePullRequest prompts user to confirm whether to auto-merge promotion PR or not ConfirmAutoMergePullRequest() (bool, error) // PrintNoPromotableReleasesFound prints message that no promotable releases were found for given // source and target environments or potentially none because release filtering was applied. PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment) // PrintNoPromotableEnvironmentFound prints message that no promotable environments were found // or potentially none because environment filtering was applied. PrintNoPromotableEnvironmentFound(environmentsFiltered bool) // PrintStartPreview starts the preview of release promotion diffs. PrintStartPreview() // PrintReleasePreview prints the diff for promotion of a given release. PrintReleasePreview(targetEnvName string, releaseName string, existingTargetFile, promotedFile *yml.File) error // PrintEndPreview ends the preview of release promotion diffs. PrintEndPreview() // PrintUpdatingTargetRelease prints message that target release file is being updated or created. PrintUpdatingTargetRelease(targetEnvName, releaseName, releaseFilePath string, isCreating bool) // PrintBranchCreated prints message that a new promotion branch was created and promotion changes were committed // and pushed. PrintBranchCreated(branchName, message string) // PrintDraftPullRequestCreated prints message that a new promotion draft pull request was created. PrintDraftPullRequestCreated(url string) // PrintPullRequestCreated prints message that a new promotion pull request was created. PrintPullRequestCreated(url string) // PrintCanceled prints message that promotion was canceled and no pull request was created. PrintCanceled() // PrintCompleted prints message that the whole promotion operation was completed. PrintCompleted() // PrintSelectedNonPromotableReleases prints message that non-promotable releases were selected. PrintSelectedNonPromotableReleases(invalidReleases, targetEnvName string) }
type ReleaseInfo ¶ added in v0.31.4
type ReleaseInfo struct { Name string Project *v1alpha1.Project Repository string Source ReleaseWithGitTag Target ReleaseWithGitTag OlderGitTag string NewerGitTag string IsPrerelease bool IsUpgrade bool Commits []*CommitInfo Error error }
type ReleaseWithGitTag ¶ added in v0.31.4
type ShellGitProvider ¶
type ShellGitProvider struct {
// contains filtered or unexported fields
}
func NewShellGitProvider ¶
func NewShellGitProvider(dir string) *ShellGitProvider
func (*ShellGitProvider) CheckoutMasterBranch ¶
func (g *ShellGitProvider) CheckoutMasterBranch() error
func (*ShellGitProvider) CreateAndPushBranchWithFiles ¶
func (g *ShellGitProvider) CreateAndPushBranchWithFiles(branchName string, files []string, message string) error
func (*ShellGitProvider) EnsureCleanAndUpToDateWorkingCopy ¶
func (g *ShellGitProvider) EnsureCleanAndUpToDateWorkingCopy() error
type YamlWriter ¶
Click to show internal directories.
Click to hide internal directories.