scm

package
v0.7.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSCMToken added in v0.3.0

func GenerateSCMToken(config *api.SCMConfig) error

GenerateSCMToken generates the SCM token according to the config. Make sure the type, server of the SCM is provided. If the SCM is Github, the username is required. If the access token is provided, it should be checked whether has authority of repos. Generate new token only when the username and password are provided at the same time.

func NewTagFromLatest added in v0.5.0

func NewTagFromLatest(codeSource *api.CodeSource, scm *api.SCMConfig, tagName, description string) error

func RegisterProvider added in v0.3.0

func RegisterProvider(scmType api.SCMType, pFunc newSCMProviderFunc) error

RegisterProvider registers SCM providers.

Types

type EventType added in v0.5.0

type EventType string
const (
	PullRequestEventType        EventType = "PullRequest"
	PullRequestCommentEventType EventType = "PullRequestComment"
	PushEventType               EventType = "Push"
	TagReleaseEventType         EventType = "TagRelease"
)

type SCMProvider added in v0.3.0

type SCMProvider interface {
	GetToken() (string, error)
	ListRepos() ([]api.Repository, error)
	ListBranches(repo string) ([]string, error)
	ListTags(repo string) ([]string, error)
	GetTemplateType(repo string) (string, error)
	CheckToken() bool
	NewTagFromLatest(tagName, description, commitID, url string) error
	CreateWebHook(repoURL string, webHook *WebHook) error
	DeleteWebHook(repoURL string, webHookUrl string) error
	CreateStatus(recordStatus api.Status, targetURL, repoURL, commitSha string) error
}

SCMProvider represents the interface of SCM provider.

func GetSCMProvider added in v0.3.0

func GetSCMProvider(scm *api.SCMConfig) (SCMProvider, error)

GetSCMProvider gets the SCM provider by the type.

type WebHook added in v0.5.0

type WebHook struct {
	Events []EventType
	Url    string
}

WebHook represents the params for SCM webhook.

Directories

Path Synopsis
svn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL