Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToValidBranchName(name string) string
- func DiscoverRemoteGitURL(gitConf string) (string, error)
- func DiscoverUpstreamGitURL(gitConf string) (string, error)
- func FindGitConfigDir(dir string) (string, string, error)
- func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepositoryInfo) (string, error)
- func GetCurrentGitTagSHA(dir string) (string, error)
- func GetGitServer(dir string) (string, error)
- func GetPreviousGitTagSHA(dir string) (string, error)
- func GetRemoteUrl(config *gitcfg.Config, name string) string
- func GitAdd(dir string, args ...string) error
- func GitClone(url string, directory string) error
- func GitCloneOrPull(url string, directory string) error
- func GitCmd(dir string, args ...string) error
- func GitCommit(dir string, message string) error
- func GitCommitIfChanges(dir string, message string) error
- func GitCreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error)
- func GitGetBranch(dir string) (string, error)
- func GitGetRemoteBranchNames(dir string, prefix string) ([]string, error)
- func GitHubAccessTokenURL(url string) string
- func GitInit(dir string) error
- func GitIsFork(gitProvider GitProvider, gitInfo *GitRepositoryInfo, dir string) (bool, error)
- func GitPush(dir string) error
- func GitRepoName(org, repoName string) string
- func GitStatus(dir string) error
- func GiteaAccessTokenURL(url string) string
- func HasChanges(dir string) (bool, error)
- func IsGitRepoStatusFailed(statuses ...*GitRepoStatus) bool
- func IsGitRepoStatusSuccess(statuses ...*GitRepoStatus) bool
- func PickOrganisation(orgLister OrganisationLister, userName string) (string, error)
- func PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, o io.Writer)
- func ProviderAccessTokenURL(kind string, url string) string
- func SetRemoteURL(dir string, name string, gitURL string) error
- type BitbucketProvider
- func (b *BitbucketProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (b *BitbucketProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (b *BitbucketProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (b *BitbucketProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (b *BitbucketProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (b *BitbucketProvider) CreateWebHook(data *GitWebHookArguments) error
- func (b *BitbucketProvider) DeleteRepository(org string, name string) error
- func (b *BitbucketProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (b *BitbucketProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (b *BitbucketProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (b *BitbucketProvider) HasIssues() bool
- func (b *BitbucketProvider) IsBitbucket() bool
- func (b *BitbucketProvider) IsGitHub() bool
- func (b *BitbucketProvider) IsGitea() bool
- func (p *BitbucketProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (b *BitbucketProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (b *BitbucketProvider) Kind() string
- func (b *BitbucketProvider) Label() string
- func (b *BitbucketProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (b *BitbucketProvider) ListOrganisations() ([]GitOrganisation, error)
- func (b *BitbucketProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (b *BitbucketProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (b *BitbucketProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (b *BitbucketProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (b *BitbucketProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)
- func (b *BitbucketProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (b *BitbucketProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (b *BitbucketProvider) ValidateRepositoryName(org string, name string) error
- type CommitGroup
- type CommitInfo
- type CreateRepoData
- type GitHubProvider
- func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (p *GitHubProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (p *GitHubProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (p *GitHubProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (p *GitHubProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (p *GitHubProvider) CreateWebHook(data *GitWebHookArguments) error
- func (p *GitHubProvider) DeleteRepository(org string, name string) error
- func (p *GitHubProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (p *GitHubProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (p *GitHubProvider) HasIssues() bool
- func (p *GitHubProvider) IsGitHub() bool
- func (p *GitHubProvider) IsGitea() bool
- func (p *GitHubProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (p *GitHubProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (p *GitHubProvider) Kind() string
- func (p *GitHubProvider) Label() string
- func (p *GitHubProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)
- func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *GitHubProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (p *GitHubProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (p *GitHubProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (p *GitHubProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)
- func (p *GitHubProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (p *GitHubProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (p *GitHubProvider) ValidateRepositoryName(org string, name string) error
- type GitIssue
- type GitLabel
- type GitOrganisation
- type GitProvider
- func CreateProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
- func NewBitbucketProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
- func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
- func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
- type GitPullRequest
- type GitPullRequestArguments
- type GitRelease
- type GitRepoStatus
- type GitRepository
- type GitRepositoryInfo
- func (i *GitRepositoryInfo) CreateProvider(authConfigSvc auth.AuthConfigService, gitKind string) (GitProvider, error)
- func (i *GitRepositoryInfo) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string) (GitProvider, error)
- func (i *GitRepositoryInfo) HostURL() string
- func (i *GitRepositoryInfo) HostURLWithoutUser() string
- func (i *GitRepositoryInfo) HttpCloneURL() string
- func (i *GitRepositoryInfo) HttpURL() string
- func (i *GitRepositoryInfo) HttpsURL() string
- func (i *GitRepositoryInfo) IsGitHub() bool
- func (i *GitRepositoryInfo) PickOrCreateProvider(authConfigSvc auth.AuthConfigService, message string, batchMode bool, ...) (GitProvider, error)
- func (i *GitRepositoryInfo) PipelinePath() string
- func (i *GitRepositoryInfo) PullRequestURL(prName string) string
- type GitRepositoryOptions
- type GitUser
- type GitWebHookArguments
- type GiteaProvider
- func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (p *GiteaProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (p *GiteaProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (p *GiteaProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (p *GiteaProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (p *GiteaProvider) CreateWebHook(data *GitWebHookArguments) error
- func (p *GiteaProvider) DeleteRepository(org string, name string) error
- func (p *GiteaProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (p *GiteaProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (p *GiteaProvider) HasIssues() bool
- func (p *GiteaProvider) IsGitHub() bool
- func (p *GiteaProvider) IsGitea() bool
- func (p *GiteaProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (p *GiteaProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (p *GiteaProvider) Kind() string
- func (p *GiteaProvider) Label() string
- func (p *GiteaProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)
- func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *GiteaProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (p *GiteaProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (p *GiteaProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (p *GiteaProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)
- func (p *GiteaProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (p *GiteaProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (p *GiteaProvider) ValidateRepositoryName(org string, name string) error
- type GroupAndCommitInfos
- type OrganisationLister
Constants ¶
const (
GitHubHost = "github.com"
)
Variables ¶
var ( // ConventionalCommitTitles textual descriptions for // Conventional Commit types: https://conventionalcommits.org/ ConventionalCommitTitles = map[string]*CommitGroup{ "feat": createCommitGroup("Features"), "fix": createCommitGroup("Bug Fixes"), "perf": createCommitGroup("Performance Improvements"), "refactor": createCommitGroup("Code Refactoring"), "docs": createCommitGroup("Documentation"), "test": createCommitGroup("Tests"), "revert": createCommitGroup("Reverts"), "style": createCommitGroup("Styles"), "chore": createCommitGroup("Chores"), "": createCommitGroup(""), } )
Functions ¶
func ConvertToValidBranchName ¶
ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters
func DiscoverRemoteGitURL ¶ added in v1.0.13
func DiscoverUpstreamGitURL ¶ added in v1.0.97
func FindGitConfigDir ¶
FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories
func GenerateMarkdown ¶ added in v1.0.100
func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepositoryInfo) (string, error)
GenerateMarkdown generates the markdown document for the commits
func GetCurrentGitTagSHA ¶ added in v1.0.90
func GetGitServer ¶ added in v1.0.74
func GetPreviousGitTagSHA ¶ added in v1.0.90
func GitCloneOrPull ¶ added in v1.1.3
GitCloneOrPull will clone the given git URL or pull if it alreasy exists
func GitCommitIfChanges ¶
func GitCreatePushURL ¶
GitCreatePushURL creates the git repository URL with the username and password encoded for HTTPS based URLs
func GitGetBranch ¶ added in v1.0.83
func GitGetRemoteBranchNames ¶ added in v1.0.14
func GitHubAccessTokenURL ¶ added in v1.0.16
func GitIsFork ¶ added in v1.0.112
func GitIsFork(gitProvider GitProvider, gitInfo *GitRepositoryInfo, dir string) (bool, error)
func GitRepoName ¶
func GiteaAccessTokenURL ¶ added in v1.0.16
func HasChanges ¶
func IsGitRepoStatusFailed ¶ added in v1.0.80
func IsGitRepoStatusFailed(statuses ...*GitRepoStatus) bool
IsGitRepoStatusFailed returns true if any of the statuses have failed
func IsGitRepoStatusSuccess ¶ added in v1.0.80
func IsGitRepoStatusSuccess(statuses ...*GitRepoStatus) bool
IsGitRepoStatusSuccess returns true if all the statuses are successful
func PickOrganisation ¶
func PickOrganisation(orgLister OrganisationLister, userName string) (string, error)
PickOrganisation picks an organisations login if there is one available
func PrintCreateRepositoryGenerateAccessToken ¶ added in v1.0.40
func PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, o io.Writer)
func ProviderAccessTokenURL ¶ added in v1.0.16
Types ¶
type BitbucketProvider ¶ added in v1.1.24
type BitbucketProvider struct { Client *bitbucket.APIClient Username string Context context.Context Server auth.AuthServer User auth.UserAuth }
BitbucketProvider mplements GitProvider interface for bitbucket.org
func (*BitbucketProvider) AddPRComment ¶ added in v1.1.24
func (b *BitbucketProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*BitbucketProvider) CreateIssue ¶ added in v1.1.24
func (*BitbucketProvider) CreateIssueComment ¶ added in v1.1.24
func (*BitbucketProvider) CreatePullRequest ¶ added in v1.1.24
func (b *BitbucketProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*BitbucketProvider) CreateRepository ¶ added in v1.1.24
func (b *BitbucketProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*BitbucketProvider) CreateWebHook ¶ added in v1.1.24
func (b *BitbucketProvider) CreateWebHook(data *GitWebHookArguments) error
func (*BitbucketProvider) DeleteRepository ¶ added in v1.1.24
func (b *BitbucketProvider) DeleteRepository(org string, name string) error
func (*BitbucketProvider) ForkRepository ¶ added in v1.1.24
func (b *BitbucketProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*BitbucketProvider) GetRepository ¶ added in v1.1.24
func (b *BitbucketProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*BitbucketProvider) HasIssues ¶ added in v1.1.24
func (b *BitbucketProvider) HasIssues() bool
func (*BitbucketProvider) IsBitbucket ¶ added in v1.1.24
func (b *BitbucketProvider) IsBitbucket() bool
func (*BitbucketProvider) IsGitHub ¶ added in v1.1.24
func (b *BitbucketProvider) IsGitHub() bool
func (*BitbucketProvider) IsGitea ¶ added in v1.1.24
func (b *BitbucketProvider) IsGitea() bool
func (*BitbucketProvider) JenkinsWebHookPath ¶ added in v1.1.24
func (b *BitbucketProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*BitbucketProvider) Kind ¶ added in v1.1.24
func (b *BitbucketProvider) Kind() string
func (*BitbucketProvider) Label ¶ added in v1.1.24
func (b *BitbucketProvider) Label() string
func (*BitbucketProvider) ListCommitStatus ¶ added in v1.1.24
func (b *BitbucketProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*BitbucketProvider) ListOrganisations ¶ added in v1.1.24
func (b *BitbucketProvider) ListOrganisations() ([]GitOrganisation, error)
func (*BitbucketProvider) ListRepositories ¶ added in v1.1.24
func (b *BitbucketProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*BitbucketProvider) MergePullRequest ¶ added in v1.1.24
func (b *BitbucketProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*BitbucketProvider) PullRequestLastCommitStatus ¶ added in v1.1.24
func (b *BitbucketProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*BitbucketProvider) RenameRepository ¶ added in v1.1.24
func (b *BitbucketProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*BitbucketProvider) SearchIssues ¶ added in v1.1.24
func (*BitbucketProvider) UpdatePullRequestStatus ¶ added in v1.1.24
func (b *BitbucketProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*BitbucketProvider) UpdateRelease ¶ added in v1.1.24
func (b *BitbucketProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*BitbucketProvider) ValidateRepositoryName ¶ added in v1.1.24
func (b *BitbucketProvider) ValidateRepositoryName(org string, name string) error
type CommitGroup ¶ added in v1.0.100
func ConventionalCommitTypeToTitle ¶ added in v1.0.99
func ConventionalCommitTypeToTitle(kind string) *CommitGroup
ConventionalCommitTypeToTitle returns the title of the conventional commit type see: https://conventionalcommits.org/
type CommitInfo ¶ added in v1.0.99
type CommitInfo struct { Kind string Feature string Message string // contains filtered or unexported fields }
func ParseCommit ¶ added in v1.0.99
func ParseCommit(message string) *CommitInfo
ParseCommit parses a conventional commit see: https://conventionalcommits.org/
func (*CommitInfo) Group ¶ added in v1.0.100
func (c *CommitInfo) Group() *CommitGroup
func (*CommitInfo) Order ¶ added in v1.0.100
func (c *CommitInfo) Order() int
func (*CommitInfo) Title ¶ added in v1.0.99
func (c *CommitInfo) Title() string
type CreateRepoData ¶
type CreateRepoData struct { Organisation string RepoName string FullName string PrivateRepo bool User *auth.UserAuth GitProvider GitProvider }
func PickNewGitRepository ¶
func PickNewGitRepository(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, defaultRepoName string, repoOptions GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth) (*CreateRepoData, error)
func (*CreateRepoData) CreateRepository ¶
func (d *CreateRepoData) CreateRepository() (*GitRepository, error)
CreateRepository creates the repository - failing if it already exists
func (*CreateRepoData) GetRepository ¶ added in v1.0.82
func (d *CreateRepoData) GetRepository() (*GitRepository, error)
GetRepository returns the repository if it already exists
type GitHubProvider ¶
type GitHubProvider struct { Username string Client *github.Client Context context.Context Server auth.AuthServer User auth.UserAuth }
func (*GitHubProvider) AddPRComment ¶ added in v1.0.91
func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GitHubProvider) CreateIssue ¶ added in v1.0.112
func (*GitHubProvider) CreateIssueComment ¶ added in v1.0.101
func (*GitHubProvider) CreatePullRequest ¶
func (p *GitHubProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GitHubProvider) CreateRepository ¶
func (p *GitHubProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GitHubProvider) CreateWebHook ¶ added in v1.0.6
func (p *GitHubProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GitHubProvider) DeleteRepository ¶ added in v1.0.6
func (p *GitHubProvider) DeleteRepository(org string, name string) error
func (*GitHubProvider) ForkRepository ¶
func (p *GitHubProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*GitHubProvider) GetRepository ¶ added in v1.0.82
func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*GitHubProvider) HasIssues ¶ added in v1.0.97
func (p *GitHubProvider) HasIssues() bool
func (*GitHubProvider) IsGitHub ¶
func (p *GitHubProvider) IsGitHub() bool
func (*GitHubProvider) IsGitea ¶ added in v1.1.15
func (p *GitHubProvider) IsGitea() bool
func (*GitHubProvider) JenkinsWebHookPath ¶ added in v1.0.6
func (p *GitHubProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GitHubProvider) Kind ¶ added in v1.1.15
func (p *GitHubProvider) Kind() string
func (*GitHubProvider) Label ¶ added in v1.0.16
func (p *GitHubProvider) Label() string
func (*GitHubProvider) ListCommitStatus ¶ added in v1.0.80
func (p *GitHubProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GitHubProvider) ListOrganisations ¶
func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)
func (*GitHubProvider) ListRepositories ¶ added in v1.0.6
func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GitHubProvider) MergePullRequest ¶ added in v1.0.80
func (p *GitHubProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GitHubProvider) PullRequestLastCommitStatus ¶ added in v1.0.80
func (p *GitHubProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GitHubProvider) RenameRepository ¶
func (p *GitHubProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*GitHubProvider) SearchIssues ¶ added in v1.1.23
func (*GitHubProvider) UpdatePullRequestStatus ¶ added in v1.0.63
func (p *GitHubProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GitHubProvider) UpdateRelease ¶ added in v1.0.100
func (p *GitHubProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GitHubProvider) ValidateRepositoryName ¶
func (p *GitHubProvider) ValidateRepositoryName(org string, name string) error
type GitIssue ¶ added in v1.0.97
type GitLabel ¶ added in v1.0.97
func ToGitLabels ¶ added in v1.1.23
ToGitLabels converts the list of label names into an array of GitLabels
type GitOrganisation ¶
type GitOrganisation struct {
Login string
}
type GitProvider ¶
type GitProvider interface { OrganisationLister ListRepositories(org string) ([]*GitRepository, error) CreateRepository(org string, name string, private bool) (*GitRepository, error) GetRepository(org string, name string) (*GitRepository, error) DeleteRepository(org string, name string) error ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error) RenameRepository(org string, name string, newName string) (*GitRepository, error) ValidateRepositoryName(org string, name string) error CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error) UpdatePullRequestStatus(pr *GitPullRequest) error PullRequestLastCommitStatus(pr *GitPullRequest) (string, error) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error) MergePullRequest(pr *GitPullRequest, message string) error CreateWebHook(data *GitWebHookArguments) error IsGitHub() bool IsGitea() bool Kind() string GetIssue(org string, name string, number int) (*GitIssue, error) IssueURL(org string, name string, number int, isPull bool) string SearchIssues(org string, name string, query string) ([]*GitIssue, error) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error) HasIssues() bool AddPRComment(pr *GitPullRequest, comment string) error CreateIssueComment(owner string, repo string, number int, comment string) error UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error JenkinsWebHookPath(gitURL string, secret string) string Label() string }
func CreateProvider ¶
func CreateProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
func NewBitbucketProvider ¶ added in v1.1.24
func NewBitbucketProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
NewBitbucketProvider is a constructor for type BitbucketProvider
func NewGitHubProvider ¶
func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
func NewGiteaProvider ¶ added in v1.0.16
func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)
type GitPullRequest ¶
type GitPullRequest struct { URL string Owner string Repo string Number *int Mergeable *bool Merged *bool State *string StatusesURL *string IssueURL *string DiffURL *string MergeCommitSHA *string ClosedAt *time.Time MergedAt *time.Time LastCommitSha string }
func (*GitPullRequest) IsClosed ¶ added in v1.0.63
func (pr *GitPullRequest) IsClosed() bool
IsClosed returns true if the PullRequest has been closed
type GitPullRequestArguments ¶
type GitRelease ¶ added in v1.0.100
type GitRepoStatus ¶ added in v1.0.80
type GitRepoStatus struct { ID int64 Context string URL string // State is the current state of the repository. Possible values are: // pending, success, error, or failure. State string `json:"state,omitempty"` // TargetURL is the URL of the page representing this status TargetURL string `json:"target_url,omitempty"` // Description is a short high level summary of the status. Description string }
func (*GitRepoStatus) IsFailed ¶ added in v1.0.80
func (s *GitRepoStatus) IsFailed() bool
func (*GitRepoStatus) IsSuccess ¶ added in v1.0.80
func (s *GitRepoStatus) IsSuccess() bool
type GitRepository ¶
type GitRepository struct { Name string AllowMergeCommit bool HTMLURL string CloneURL string SSHURL string Language string Fork bool }
func PickRepositories ¶ added in v1.0.6
func PickRepositories(provider GitProvider, owner string, message string, selectAll bool, filter string) ([]*GitRepository, error)
func RepoFromRepo ¶ added in v1.1.24
func RepoFromRepo(bRepo bitbucket.Repository) *GitRepository
Map bitbucket.Repository to GitRepository
type GitRepositoryInfo ¶
type GitRepositoryInfo struct { URL string Scheme string Host string Organisation string Name string }
func GetGitInfo ¶ added in v1.0.91
func GetGitInfo(dir string) (*GitRepositoryInfo, error)
func ParseGitURL ¶
func ParseGitURL(text string) (*GitRepositoryInfo, error)
ParseGitURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation and name
func (*GitRepositoryInfo) CreateProvider ¶ added in v1.0.91
func (i *GitRepositoryInfo) CreateProvider(authConfigSvc auth.AuthConfigService, gitKind string) (GitProvider, error)
func (*GitRepositoryInfo) CreateProviderForUser ¶
func (i *GitRepositoryInfo) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string) (GitProvider, error)
func (*GitRepositoryInfo) HostURL ¶ added in v1.0.100
func (i *GitRepositoryInfo) HostURL() string
HostURL returns the URL to the host
func (*GitRepositoryInfo) HostURLWithoutUser ¶ added in v1.0.114
func (i *GitRepositoryInfo) HostURLWithoutUser() string
func (*GitRepositoryInfo) HttpCloneURL ¶ added in v1.0.83
func (i *GitRepositoryInfo) HttpCloneURL() string
HttpCloneURL returns the HTTPS git URL this repository
func (*GitRepositoryInfo) HttpURL ¶ added in v1.0.95
func (i *GitRepositoryInfo) HttpURL() string
HttpURL returns the URL to browse this repository in a web browser
func (*GitRepositoryInfo) HttpsURL ¶ added in v1.1.15
func (i *GitRepositoryInfo) HttpsURL() string
HttpsURL returns the URL to browse this repository in a web browser
func (*GitRepositoryInfo) IsGitHub ¶
func (i *GitRepositoryInfo) IsGitHub() bool
func (*GitRepositoryInfo) PickOrCreateProvider ¶
func (i *GitRepositoryInfo) PickOrCreateProvider(authConfigSvc auth.AuthConfigService, message string, batchMode bool, gitKind string) (GitProvider, error)
func (*GitRepositoryInfo) PipelinePath ¶ added in v1.1.10
func (i *GitRepositoryInfo) PipelinePath() string
PipelinePath returns the pipeline path for the master branch which can be used to query pipeline logs in `jx get build logs myPipelinePath`
func (*GitRepositoryInfo) PullRequestURL ¶ added in v1.0.83
func (i *GitRepositoryInfo) PullRequestURL(prName string) string
PullRequestURL returns the URL of a pull request of the given name/number
type GitRepositoryOptions ¶ added in v1.0.37
type GitWebHookArguments ¶ added in v1.0.6
type GiteaProvider ¶ added in v1.0.16
type GiteaProvider struct { Username string Client *gitea.Client Server auth.AuthServer User auth.UserAuth }
func (*GiteaProvider) AddPRComment ¶ added in v1.0.91
func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GiteaProvider) CreateIssue ¶ added in v1.0.112
func (*GiteaProvider) CreateIssueComment ¶ added in v1.0.101
func (*GiteaProvider) CreatePullRequest ¶ added in v1.0.16
func (p *GiteaProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GiteaProvider) CreateRepository ¶ added in v1.0.16
func (p *GiteaProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GiteaProvider) CreateWebHook ¶ added in v1.0.16
func (p *GiteaProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GiteaProvider) DeleteRepository ¶ added in v1.0.16
func (p *GiteaProvider) DeleteRepository(org string, name string) error
func (*GiteaProvider) ForkRepository ¶ added in v1.0.16
func (p *GiteaProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*GiteaProvider) GetRepository ¶ added in v1.0.82
func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*GiteaProvider) HasIssues ¶ added in v1.0.97
func (p *GiteaProvider) HasIssues() bool
func (*GiteaProvider) IsGitHub ¶ added in v1.0.16
func (p *GiteaProvider) IsGitHub() bool
func (*GiteaProvider) IsGitea ¶ added in v1.1.15
func (p *GiteaProvider) IsGitea() bool
func (*GiteaProvider) JenkinsWebHookPath ¶ added in v1.0.16
func (p *GiteaProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GiteaProvider) Kind ¶ added in v1.1.15
func (p *GiteaProvider) Kind() string
func (*GiteaProvider) Label ¶ added in v1.0.16
func (p *GiteaProvider) Label() string
func (*GiteaProvider) ListCommitStatus ¶ added in v1.0.80
func (p *GiteaProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GiteaProvider) ListOrganisations ¶ added in v1.0.16
func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)
func (*GiteaProvider) ListRepositories ¶ added in v1.0.16
func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GiteaProvider) MergePullRequest ¶ added in v1.0.80
func (p *GiteaProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GiteaProvider) PullRequestLastCommitStatus ¶ added in v1.0.80
func (p *GiteaProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GiteaProvider) RenameRepository ¶ added in v1.0.16
func (p *GiteaProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*GiteaProvider) SearchIssues ¶ added in v1.1.23
func (*GiteaProvider) UpdatePullRequestStatus ¶ added in v1.0.63
func (p *GiteaProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GiteaProvider) UpdateRelease ¶ added in v1.0.100
func (p *GiteaProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GiteaProvider) ValidateRepositoryName ¶ added in v1.0.16
func (p *GiteaProvider) ValidateRepositoryName(org string, name string) error
type GroupAndCommitInfos ¶ added in v1.0.100
type GroupAndCommitInfos struct {
// contains filtered or unexported fields
}
type OrganisationLister ¶ added in v1.1.25
type OrganisationLister interface {
ListOrganisations() ([]GitOrganisation, error)
}