Documentation ¶
Index ¶
- Constants
- type GitApplyPatchCommand
- func (self *GitApplyPatchCommand) Execute(pluginLogger plugin.Logger, pluginCom plugin.PluginCommunicator, ...) error
- func (self GitApplyPatchCommand) GetPatch(conf *model.TaskConfig, pluginCom plugin.PluginCommunicator, ...) (*patch.Patch, error)
- func (self *GitApplyPatchCommand) Name() string
- func (self *GitApplyPatchCommand) ParseParams(params map[string]interface{}) error
- func (self *GitApplyPatchCommand) Plugin() string
- type GitGetProjectCommand
- type GitPlugin
- func (self *GitPlugin) Configure(map[string]interface{}) error
- func (self *GitPlugin) GetAPIHandler() http.Handler
- func (self *GitPlugin) GetPanelConfig() (*plugin.PanelConfig, error)
- func (self *GitPlugin) GetUIHandler() http.Handler
- func (self *GitPlugin) Name() string
- func (self *GitPlugin) NewCommand(cmdName string) (plugin.Command, error)
Constants ¶
const ( GetProjectCmdName = "get_project" ApplyPatchCmdName = "apply_patch" GitPluginName = "git" GitPatchPath = "patch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitApplyPatchCommand ¶
type GitApplyPatchCommand struct { //The root directory (locally) that the code should be checked out into. //Must be a valid non-blank directory name. Directory string }
GitApplyPatchCommand is a command to pull a patch from the api server and apply it to the given directory using `git apply`. If there are module patch sets included in the patch, those are applied to their proper directory as well.
func (*GitApplyPatchCommand) Execute ¶
func (self *GitApplyPatchCommand) Execute(pluginLogger plugin.Logger, pluginCom plugin.PluginCommunicator, conf *model.TaskConfig, stop chan bool) error
Execute pulls the task's patch and then applies it
func (GitApplyPatchCommand) GetPatch ¶
func (self GitApplyPatchCommand) GetPatch(conf *model.TaskConfig, 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 (*GitApplyPatchCommand) Name ¶
func (self *GitApplyPatchCommand) Name() string
func (*GitApplyPatchCommand) ParseParams ¶
func (self *GitApplyPatchCommand) ParseParams(params map[string]interface{}) error
ParseParams reads the command's configuration and returns any errors that occur.
func (*GitApplyPatchCommand) Plugin ¶
func (self *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 }
GitGetProjectCommand is a command that fetches source code from git for the project associated with the current task
func (*GitGetProjectCommand) Execute ¶
func (self *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) Name ¶
func (self *GitGetProjectCommand) Name() string
func (*GitGetProjectCommand) ParseParams ¶
func (self *GitGetProjectCommand) ParseParams(params map[string]interface{}) error
ParseParams parses the command's configuration. Fulfills the Command interface.
func (*GitGetProjectCommand) Plugin ¶
func (self *GitGetProjectCommand) Plugin() string
type GitPlugin ¶
type GitPlugin struct{}
GitPlugin handles fetching source code and applying patches using the git version control system.
func (*GitPlugin) GetAPIHandler ¶
func (*GitPlugin) GetPanelConfig ¶
func (self *GitPlugin) GetPanelConfig() (*plugin.PanelConfig, error)
GetPanelConfig is required to fulfill the Plugin interface. This plugin does not have any UI hooks.