jenkins

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCLI

func NewFromCLI(c *cli.Context, tracer opentracing.Tracer) (eventsources.EventSource, error)

Types

type BuildEvent

type BuildEvent struct {
	QueueTime       int               `json:"queueTime"`
	Result          string            `json:"result"`
	CiURL           string            `json:"ciUrl"`
	ContextID       int               `json:"contextId"`
	FullJobName     string            `json:"fullJobName"`
	Parameters      map[string]string `json:"parameters"`
	BuildURL        string            `json:"buildUrl"`
	BuildCause      string            `json:"buildCause"`
	StartTime       int               `json:"startTime"`
	Number          int               `json:"number"`
	StartedUsername string            `json:"startedUsername"`
	JobName         string            `json:"jobName"`
	SlaveInfo       struct {
		SlaveName string `json:"slaveName"`
		Executor  string `json:"executor"`
		Label     string `json:"label"`
	} `json:"slaveInfo"`
	ScmInfo       *ScmInfo `json:"scmInfo,omitempty"`
	StartedUserID string   `json:"startedUserId"`
	Duration      int      `json:"duration"`
	EndTime       int      `json:"endTime"`
}

func (BuildEvent) IsError

func (be BuildEvent) IsError() (bool, error)

func (BuildEvent) OperationName

func (be BuildEvent) OperationName() string

OperationName determines if the event is a `deploy` or a `build` based on the presence of a `type:deploy` tag.

func (BuildEvent) ParentSpanID

func (be BuildEvent) ParentSpanID() (*string, error)

ParentSpanID inspects the Jenkins Event payload to determine what the parent span is. First will check to see if the parent is explicitly specified in build params Then will check if the build is part of SCM

func (BuildEvent) SpanID

func (be BuildEvent) SpanID() (string, error)

func (BuildEvent) State

func (BuildEvent) String

func (be BuildEvent) String() (string, error)

func (BuildEvent) Tags

func (be BuildEvent) Tags() (map[string]interface{}, error)

func (BuildEvent) Timings added in v0.3.0

func (be BuildEvent) Timings() (eventsources.EventTimings, error)

type BuildState

type BuildState int

type ScmInfo

type ScmInfo struct {
	URL    string  `json:"url"`
	Commit string  `json:"commit"`
	Branch *string `json:"branch,omitempty"`
}

type Source

type Source struct {
	// contains filtered or unexported fields
}

func NewSource

func NewSource(tracer opentracing.Tracer) (*Source, error)

func (*Source) Event

func (s *Source) Event(r *http.Request, payload []byte) (eventsources.Event, error)

func (Source) Name

func (s Source) Name() string

func (*Source) SecretKey

func (s *Source) SecretKey() []byte

func (*Source) Tracer

func (s *Source) Tracer() opentracing.Tracer

func (*Source) ValidatePayload

func (s *Source) ValidatePayload(r *http.Request, secretKey []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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