Documentation ¶
Index ¶
- func ContainsLabel(labels []*scm.Label, label string) bool
- func DiscoverGitKind(jxClient versioned.Interface, namespace, gitServerURL string) (string, error)
- func FindPullRequestFromEnvironment() (int, error)
- func GetPasswordFromSourceURL(sourceURL string) (string, error)
- func IsScmNotFound(err error) bool
- func NewScmClient(kind, gitServerURL, token string) (*scm.Client, string, error)
- type CreateRepository
- type Factory
- type Options
- type PullRequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsLabel ¶ added in v1.0.64
ContainsLabel returns true if the given labels contains the given label name
func DiscoverGitKind ¶ added in v1.0.80
DiscoverGitKind discovers the git kind for the given git server from the SourceRepository resources. If no jxClient is provided it is lazily created
func FindPullRequestFromEnvironment ¶ added in v1.0.59
FindPullRequestFromEnvironment returns the PullRequest number by looking for common Jenkins X environment variables
func GetPasswordFromSourceURL ¶
GetPasswordFromSourceURL returns password from the git URL
func IsScmNotFound ¶ added in v1.0.59
Types ¶
type CreateRepository ¶ added in v1.0.59
type CreateRepository struct { GitServer string GitKind string Owner string Repository string CurrentUsername string GitPublic bool }
func (*CreateRepository) ConfirmValues ¶ added in v1.0.59
func (r *CreateRepository) ConfirmValues(i input.Interface, batch bool) error
ConfirmValues confirms to the user the values to be used to create the new git repository if using batch mode lets just validate the values are supplied or fail
func (*CreateRepository) CreateRepository ¶ added in v1.0.59
func (r *CreateRepository) CreateRepository(scmClient *scm.Client) (*scm.Repository, error)
CreateRepository creates the git repository if it does not already exist
func (*CreateRepository) FullName ¶ added in v1.0.59
func (r *CreateRepository) FullName() string
type Factory ¶ added in v1.0.59
type Factory struct { GitKind string GitServerURL string Owner string GitUsername string GitToken string ScmClient *scm.Client }
Factory helper for discovering the git source URL and token
func (*Factory) CreateAuthenticatedURL ¶ added in v1.0.59
CreateAuthenticatedURL creates the Git repository URL with the username and password encoded for HTTPS based URLs
func (*Factory) FindGitToken ¶ added in v1.0.59
FindGitToken ensures the GitToken is populated
func (*Factory) GetUsername ¶ added in v1.0.59
GetUsername gets the current user name from the ScmClient if its not explicitly configured
type Options ¶
type Options struct { Dir string FullRepositoryName string Owner string Repository string Branch string ScmClient *scm.Client GitServerURL string SourceURL string GitKind string GitToken string Namespace string JXClient versioned.Interface GitURL *giturl.GitRepository GitClient gitclient.Interface CommandRunner cmdrunner.CommandRunner }
Options helper for discovering the git source URL and token
type PullRequestOptions ¶ added in v1.0.58
func (*PullRequestOptions) AddFlags ¶ added in v1.0.58
func (o *PullRequestOptions) AddFlags(cmd *cobra.Command)
AddFlags adds CLI flags
func (*PullRequestOptions) DiscoverPullRequest ¶ added in v1.0.58
func (o *PullRequestOptions) DiscoverPullRequest() (*scm.PullRequest, error)
DiscoverPullRequest discovers the pull request for the current number
func (*PullRequestOptions) Validate ¶ added in v1.0.58
func (o *PullRequestOptions) Validate() error
Validate validates the inputs are valid