hook

package
v0.0.0-...-a57a29f Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2016 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const HookLink = "" /* 127-byte string literal not displayed */

HookLink format in stash/bitbucket

Variables

This section is empty.

Functions

func CreateHook

func CreateHook(tx *sql.Tx, projectKey string, rm *sdk.RepositoriesManager, repoFullName string, application *sdk.Application, pipeline *sdk.Pipeline) (*sdk.Hook, error)

CreateHook in CDS db + repo manager webhook

func DeleteBranchBuilds

func DeleteBranchBuilds(db *sql.DB, hooks []sdk.Hook, branch string) error

DeleteBranchBuilds deletes all builds related to given branch in given applications in pipeline_build and pipeline_history

func DeleteHook

func DeleteHook(db database.QueryExecuter, id int64) error

DeleteHook removes hook from database

func FindHook

func FindHook(db database.Querier, applicationID, pipelineID int64, kind, host, project, repository string) (sdk.Hook, error)

FindHook loads a hook from its attributes

func InsertHook

func InsertHook(db database.QueryExecuter, h *sdk.Hook) error

InsertHook add link between git repository and pipeline in database

func InsertReceivedHook

func InsertReceivedHook(db *sql.DB, link string, data string) error

InsertReceivedHook insert raw data received from public handler in database

func LoadApplicationHooks

func LoadApplicationHooks(db database.Querier, applicationID int64) ([]sdk.Hook, error)

LoadApplicationHooks will load all hooks related to given application

func LoadHook

func LoadHook(db *sql.DB, id int64) (sdk.Hook, error)

LoadHook loads a single hook

func LoadHooks

func LoadHooks(db *sql.DB, project string, repository string) ([]sdk.Hook, error)

LoadHooks related to given repository

func LoadPipelineHooks

func LoadPipelineHooks(db *sql.DB, pipelineID int64, applicationID int64) ([]sdk.Hook, error)

LoadPipelineHooks will load all hooks related to given pipeline

func Recovery

func Recovery(h ReceivedHook, err error)

Recovery try to recovers hook in case of error

func TriggerPipeline

func TriggerPipeline(tx *sql.Tx, h sdk.Hook, branch string, hash string, author string, p *sdk.Pipeline, projectData *sdk.Project) (bool, error)

TriggerPipeline linked to received hook

func UpdateHook

func UpdateHook(db *sql.DB, h sdk.Hook) error

UpdateHook update the given hook

Types

type ReceivedHook

type ReceivedHook struct {
	URL        url.URL
	Data       []byte
	ProjectKey string
	Repository string
	Branch     string
	Hash       string
	Author     string
	Message    string
	UID        string
}

ReceivedHook is a temporary struct to manage received hook

Jump to

Keyboard shortcuts

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