git

package
v0.0.0-...-eeee692 Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetProjectCmdName = "get_project"
	ApplyPatchCmdName = "apply_patch"
	GitPluginName     = "git"

	GitPatchPath     = "patch"
	GitPatchFilePath = "patchfile"
)

Variables

This section is empty.

Functions

func GetPatchCommands

func GetPatchCommands(modulePatch patch.ModulePatch, dir, patchPath string) []string

GetPatchCommands, given a module patch of a patch, will return the appropriate list of commands that need to be executed. If the patch is empty it will not apply the patch.

Types

type GitApplyPatchCommand

type GitApplyPatchCommand struct{}

GitApplyPatchCommand is deprecated. Its functionality is now a part of GitGetProjectCommand.

func (*GitApplyPatchCommand) Execute

func (*GitApplyPatchCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error

func (*GitApplyPatchCommand) Name

func (*GitApplyPatchCommand) Name() string

func (*GitApplyPatchCommand) ParseParams

func (*GitApplyPatchCommand) ParseParams(params map[string]interface{}) error

func (*GitApplyPatchCommand) Plugin

func (*GitApplyPatchCommand) Plugin() string

type GitGetProjectCommand

type GitGetProjectCommand struct {
	// The root directory (locally) that the code should be checked out into.
	// Must be a valid non-blank directory name.
	Directory string `plugin:"expand"`

	// Revisions are the optional revisions associated with the modules of a project.
	// Note: If a module does not have a revision it will use the module's branch to get the project.
	Revisions map[string]string `plugin:"expand"`
}

GitGetProjectCommand is a command that fetches source code from git for the project associated with the current task

func (*GitGetProjectCommand) Execute

func (ggpc *GitGetProjectCommand) Execute(pluginLogger plugin.Logger,
	pluginCom plugin.PluginCommunicator,
	conf *model.TaskConfig,
	stop chan bool) error

Execute gets the source code required by the project

func (GitGetProjectCommand) GetPatch

func (ggpc GitGetProjectCommand) GetPatch(pluginCom plugin.PluginCommunicator, pluginLogger plugin.Logger) (*patch.Patch, error)

GetPatch tries to get the patch data from the server in json format, and unmarhals it into a patch struct. The GET request is attempted multiple times upon failure.

func (*GitGetProjectCommand) Name

func (ggpc *GitGetProjectCommand) Name() string

func (*GitGetProjectCommand) ParseParams

func (ggpc *GitGetProjectCommand) ParseParams(params map[string]interface{}) error

ParseParams parses the command's configuration. Fulfills the Command interface.

func (*GitGetProjectCommand) Plugin

func (ggpc *GitGetProjectCommand) Plugin() string

type GitPlugin

type GitPlugin struct{}

GitPlugin handles fetching source code and applying patches using the git version control system.

func (*GitPlugin) Configure

func (self *GitPlugin) Configure(map[string]interface{}) error

func (*GitPlugin) GetAPIHandler

func (self *GitPlugin) GetAPIHandler() http.Handler

func (*GitPlugin) Name

func (self *GitPlugin) Name() string

Name implements Plugin Interface.

func (*GitPlugin) NewCommand

func (self *GitPlugin) NewCommand(cmdName string) (plugin.Command, error)

NewCommand returns requested commands by name. Fulfills the Plugin interface.

Jump to

Keyboard shortcuts

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