Documentation ¶
Index ¶
- Constants
- Variables
- type AuthMode
- type BasicAuth
- type CiProjectDetails
- type GitCliManager
- type GitCliManagerImpl
- func (impl *GitCliManagerImpl) AddRepo(rootDir string, remoteUrl string) error
- func (impl *GitCliManagerImpl) Checkout(gitContext GitContext, rootDir string, checkout string) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) Clone(gitContext GitContext, prj CiProjectDetails) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) Fetch(gitContext GitContext, rootDir string) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) GitCheckout(gitContext GitContext, checkoutPath string, targetCheckout string, ...) (errMsg string, error error)
- func (impl *GitCliManagerImpl) Init(rootDir string, remoteUrl string, isBare bool) error
- func (impl *GitCliManagerImpl) Merge(rootDir string, commit string) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) RecursiveFetchSubmodules(rootDir string) (response, errMsg string, error error)
- func (impl *GitCliManagerImpl) RunCommand(cmd *exec.Cmd) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) RunCommandWithCred(cmd *exec.Cmd, userName, password string) (response, errMsg string, err error)
- func (impl *GitCliManagerImpl) UnsetCredentialHelper(rootDir string) (response, errMsg string, error error)
- func (impl *GitCliManagerImpl) UpdateCredentialHelper(rootDir string) (response, errMsg string, error error)
- type GitContext
- type GitManager
- type GitOptions
- type SourceType
- type WebhookData
Constants ¶
View Source
const ( WEBHOOK_SELECTOR_TARGET_CHECKOUT_NAME string = "target checkout" WEBHOOK_SELECTOR_SOURCE_CHECKOUT_NAME string = "source checkout" WEBHOOK_SELECTOR_TARGET_CHECKOUT_BRANCH_NAME string = "target branch name" WEBHOOK_EVENT_MERGED_ACTION_TYPE string = "merged" WEBHOOK_EVENT_NON_MERGED_ACTION_TYPE string = "non-merged" )
View Source
const DefaultRemoteName = "origin"
View Source
const GIT_AKS_PASS = "/git-ask-pass.sh"
Variables ¶
View Source
var GitManagerWireSet = wire.NewSet( NewGitManagerImpl, NewGitCliManager, wire.Bind(new(GitCliManager), new(*GitCliManagerImpl)), )
Functions ¶
This section is empty.
Types ¶
type CiProjectDetails ¶
type CiProjectDetails struct { GitRepository string `json:"gitRepository"` FetchSubmodules bool `json:"fetchSubmodules"` MaterialName string `json:"materialName"` CheckoutPath string `json:"checkoutPath"` CommitHash string `json:"commitHash"` GitTag string `json:"gitTag"` CommitTime time.Time `json:"commitTime"` SourceType SourceType `json:"sourceType"` SourceValue string `json:"sourceValue"` Type string `json:"type"` Message string `json:"message"` Author string `json:"author"` GitOptions GitOptions `json:"gitOptions"` WebhookData WebhookData `json:"webhookData"` CloningMode string `json:"cloningMode"` }
func (*CiProjectDetails) GetCheckoutBranchName ¶
func (prj *CiProjectDetails) GetCheckoutBranchName() string
type GitCliManager ¶
type GitCliManager interface { Fetch(gitContext GitContext, rootDir string) (response, errMsg string, err error) Checkout(gitContext GitContext, rootDir string, checkout string) (response, errMsg string, err error) RunCommandWithCred(cmd *exec.Cmd, userName, password string) (response, errMsg string, err error) RunCommand(cmd *exec.Cmd) (response, errMsg string, err error) Init(rootDir string, remoteUrl string, isBare bool) error Clone(gitContext GitContext, prj CiProjectDetails) (response, errMsg string, err error) Merge(rootDir string, commit string) (response, errMsg string, err error) RecursiveFetchSubmodules(rootDir string) (response, errMsg string, error error) UpdateCredentialHelper(rootDir string) (response, errMsg string, error error) UnsetCredentialHelper(rootDir string) (response, errMsg string, error error) GitCheckout(gitContext GitContext, checkoutPath string, targetCheckout string, authMode AuthMode, fetchSubmodules bool, gitRepository string) (errMsg string, error error) // contains filtered or unexported methods }
type GitCliManagerImpl ¶
type GitCliManagerImpl struct { }
func NewGitCliManager ¶
func NewGitCliManager() *GitCliManagerImpl
func (*GitCliManagerImpl) AddRepo ¶
func (impl *GitCliManagerImpl) AddRepo(rootDir string, remoteUrl string) error
func (*GitCliManagerImpl) Checkout ¶
func (impl *GitCliManagerImpl) Checkout(gitContext GitContext, rootDir string, checkout string) (response, errMsg string, err error)
func (*GitCliManagerImpl) Clone ¶
func (impl *GitCliManagerImpl) Clone(gitContext GitContext, prj CiProjectDetails) (response, errMsg string, err error)
func (*GitCliManagerImpl) Fetch ¶
func (impl *GitCliManagerImpl) Fetch(gitContext GitContext, rootDir string) (response, errMsg string, err error)
func (*GitCliManagerImpl) GitCheckout ¶
func (impl *GitCliManagerImpl) GitCheckout(gitContext GitContext, checkoutPath string, targetCheckout string, authMode AuthMode, fetchSubmodules bool, gitRepository string) (errMsg string, error error)
func (*GitCliManagerImpl) Init ¶
func (impl *GitCliManagerImpl) Init(rootDir string, remoteUrl string, isBare bool) error
func (*GitCliManagerImpl) Merge ¶
func (impl *GitCliManagerImpl) Merge(rootDir string, commit string) (response, errMsg string, err error)
setting user.name and user.email as for non-fast-forward merge, git ask for user.name and email
func (*GitCliManagerImpl) RecursiveFetchSubmodules ¶
func (impl *GitCliManagerImpl) RecursiveFetchSubmodules(rootDir string) (response, errMsg string, error error)
func (*GitCliManagerImpl) RunCommand ¶
func (impl *GitCliManagerImpl) RunCommand(cmd *exec.Cmd) (response, errMsg string, err error)
func (*GitCliManagerImpl) RunCommandWithCred ¶
func (*GitCliManagerImpl) UnsetCredentialHelper ¶
func (impl *GitCliManagerImpl) UnsetCredentialHelper(rootDir string) (response, errMsg string, error error)
func (*GitCliManagerImpl) UpdateCredentialHelper ¶
func (impl *GitCliManagerImpl) UpdateCredentialHelper(rootDir string) (response, errMsg string, error error)
type GitContext ¶
type GitManager ¶
type GitManager struct {
GitCliManager GitCliManager
}
func NewGitManagerImpl ¶
func NewGitManagerImpl(gitCliManager GitCliManager) *GitManager
func (*GitManager) CloneAndCheckout ¶
func (impl *GitManager) CloneAndCheckout(ciProjectDetails []CiProjectDetails, workingDir string) error
type GitOptions ¶
type SourceType ¶
type SourceType string
const ( SOURCE_TYPE_BRANCH_FIXED SourceType = "SOURCE_TYPE_BRANCH_FIXED" SOURCE_TYPE_WEBHOOK SourceType = "WEBHOOK" )
Click to show internal directories.
Click to hide internal directories.