Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrWrongConfig = errors.New("wrong scm configuration")
ErrWrongConfig is returned when a scm has missing attributes which are mandatory
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Kind specifies the scm kind
Kind string `yaml:",omitempty"`
// Spec specifies the scm specification
Spec interface{} `jsonschema:"type=object" yaml:",omitempty"`
// Disabled is a setting used to disable the local git repository auto configuration
Disabled bool
}
func (*Config) AutoGuess ¶ added in v0.28.0
func (c *Config) AutoGuess(configName, workingDir string, gitHandler gitgeneric.GitHandler) error
AutoGuess tries to fill the Config object receiver with the configuration auto-guessed from the provided directory It only returns an error if it fails "hard" (can't guess SCM, etc.).
func (Config) JSONSchema ¶ added in v0.23.0
JSONSchema implements the json schema interface to generate the "scm" jsonschema
type ConfigSpec ¶ added in v0.28.0
type ConfigSpec interface {
Merge(interface{}) error
}
type MockScm ¶
type MockScm struct {
ScmHandler
WorkingDir string
ChangedFiles []string
Err error
}
MockScm is a stub implementation of the `ScmHandler` interface to be used in our unit test suites.
func (*MockScm) GetChangedFiles ¶
func (*MockScm) GetDirectory ¶
type Scm ¶
type Scm struct {
Config *Config
Handler ScmHandler
PipelineID string
}
func (*Scm) GenerateSCM ¶
GenerateSCM populates the receiver's attribute "s.Handler" with the SCM implementation based on the "s.Conf" content
type ScmHandler ¶
type ScmHandler interface {
Add(files []string) error
Clone() (string, error)
Checkout() error
GetDirectory() (directory string)
Commit(message string) error
Clean() error
Push() (bool, error)
PushTag(tag string) error
PushBranch(branch string) error
GetChangedFiles(workingDir string) ([]string, error)
IsRemoteBranchUpToDate() (bool, error)
GetBranches() (sourceBranch, workingBranch, targetBranch string)
GetURL() string
}
ScmHandler is an interface offering common functions for a source control manager like git or github