Documentation ¶
Index ¶
- func NewGitHub(config Config) interfaces.VCS
- func NewIsolatedVCS(times uint) interfaces.VCS
- type Config
- type Factory
- type GitHub
- func (g *GitHub) AddChanges() error
- func (g *GitHub) Checkout(jobName string) error
- func (g *GitHub) Clone() error
- func (g *GitHub) Commit() error
- func (g *GitHub) GetDefaultBranch() error
- func (g *GitHub) GetID() (string, error)
- func (g *GitHub) OpenPullRequest(jobName string) (string, error)
- func (g *GitHub) Push() error
- func (g *GitHub) SetToken()
- type IsolatedVCS
- func (v *IsolatedVCS) AddChanges() error
- func (v *IsolatedVCS) Checkout(_ string) error
- func (v *IsolatedVCS) Clone() error
- func (v *IsolatedVCS) Commit() error
- func (v *IsolatedVCS) GetID() (string, error)
- func (v *IsolatedVCS) OpenPullRequest(_ string) (string, error)
- func (v *IsolatedVCS) Push() error
- func (v *IsolatedVCS) SetToken()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitHub ¶
func NewGitHub(config Config) interfaces.VCS
NewGitHub creates a new instance of the GitHub struct.
func NewIsolatedVCS ¶
func NewIsolatedVCS(times uint) interfaces.VCS
NewIsolatedVCS returns a new instance of IsolatedVCS.
Types ¶
type Config ¶
type Config struct { // VCSPat is the personal access token for the customer's VCS account. It must have // the necessary permissions to open pull requests and push commits to the VCSRepo specified below. VCSPat string `required:"true"` // VCSRepo is the full path of the repo containing a customer's infrastructure specification. VCSRepo string `required:"true"` // PullReviewers is the name of the pull request reviewer who will be tagged on the opened pull request. PullReviewers []string `default:"NoReviewer"` }
Config contains the values that allow for authentication and the specific repo traits needed.
type Factory ¶
type Factory struct{}
Factory is a struct that generates implementations of interfaces.VCS
type GitHub ¶
type GitHub struct { // ID is a string which is a random, 10 character unique identifier // for a cloud-concierge built commit/pull request ID string // contains filtered or unexported fields }
GitHub struct implements the VCS interface.
func (*GitHub) AddChanges ¶
AddChanges adds all code changes to be included in the next commit.
func (*GitHub) GetDefaultBranch ¶
GetDefaultBranch returns the default branch of the repository.
func (*GitHub) GetID ¶
GetID returns a string which is a random, 10 character unique identifier for a cloud-concierge built commit/pull request
func (*GitHub) OpenPullRequest ¶
OpenPullRequest opens a new pull request of committed changes to the remote repository.
type IsolatedVCS ¶
type IsolatedVCS struct {
CloneTimes uint
}
IsolatedVCS is a struct that implements interfaces.VCS for the purpose of end-to-end testing.
func (*IsolatedVCS) AddChanges ¶
func (v *IsolatedVCS) AddChanges() error
AddChanges adds all code changes to be included in the next commit.
func (*IsolatedVCS) Checkout ¶
func (v *IsolatedVCS) Checkout(_ string) error
Checkout creates a new branch within the remote repository.
func (*IsolatedVCS) Clone ¶
func (v *IsolatedVCS) Clone() error
Clone pulls a remote repository's contents into local memory.
func (*IsolatedVCS) Commit ¶
func (v *IsolatedVCS) Commit() error
Commit commits code changes to the current branch of the remote repository.
func (*IsolatedVCS) GetID ¶
func (v *IsolatedVCS) GetID() (string, error)
GetID returns a string which is a random, 10 character unique identifier for a dragondrop built commit/pull request
func (*IsolatedVCS) OpenPullRequest ¶
func (v *IsolatedVCS) OpenPullRequest(_ string) (string, error)
OpenPullRequest opens a new pull request of committed changes to the remote repository, and returns the url of this pull request
func (*IsolatedVCS) Push ¶
func (v *IsolatedVCS) Push() error
Push pushes current branch to remote repository.