hooks

package
v0.0.0-...-295d36a Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildRequest

type BuildRequest struct {
	RepoOwner       string `json:"owner"`
	RepoName        string `json:"name"`
	Ref             string `json:"ref"`
	SHA             string `json:"sha"`
	Tree            string `json:"tree"`
	BuildCheckRunID int64  `json:"buildCheckRunID"`
	DefaultBranch   string `json:"defaultBranch"`
	FromHermit      bool   `json:"fromHermit"`
}

BuildRequest are parameters to perform a build. What is sent on the build queue.

func (BuildRequest) OnDefaultBranch

func (r BuildRequest) OnDefaultBranch() bool

type Listener

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

Listener consumes build requests from a Redis queue and performs builds.

func NewListener

func NewListener(log logr.Logger, redisC *redis.Client, ctr *containerd.Client, gh *github.Client, builder *build.Builder, scanner *build.Scanner, pusher *build.Pusher, snapshotPusher *SnapshotPusher) *Listener

func (*Listener) BuildListener

func (l *Listener) BuildListener(ctx context.Context)

func (*Listener) BuildRequested

func (l *Listener) BuildRequested(ctx context.Context, req *BuildRequest) error

type Rebuilder

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

Rebuilder is a period rebuilder of project that opens pull requests when snapshots change

func NewRebuilder

func NewRebuilder(log logr.Logger, gh *github.Client, builder *build.Builder, snapshotPush *SnapshotPusher) *Rebuilder

func (*Rebuilder) Cron

func (r *Rebuilder) Cron(schedule, owner, repo, ref string)

func (*Rebuilder) Rebuild

func (r *Rebuilder) Rebuild(ctx context.Context, owner, repo, ref string) error

func (*Rebuilder) Start

func (r *Rebuilder) Start()

func (*Rebuilder) Stop

func (r *Rebuilder) Stop()

type Server

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

Server listens to GitHub webhooks and dispatches work requests to the redis queue.

func NewServer

func NewServer(log logr.Logger, redis *redis.Client, gh *github.Client, botID int64, webhookSecret []byte) *Server

func (*Server) OnPush

func (s *Server) OnPush(r *http.Request, payload []byte) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SnapshotPushRequest

type SnapshotPushRequest struct {
	RepoOwner       string
	RepoName        string
	ParentCommitSHA string
	Ref             string
	BaseTree        string
	DefaultBranch   bool
}

type SnapshotPusher

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

func NewSnapshotPusher

func NewSnapshotPusher(log logr.Logger, gh *github.Client) *SnapshotPusher

func (*SnapshotPusher) Push

func (p *SnapshotPusher) Push(ctx context.Context, req *SnapshotPushRequest, snap *proxy.Snapshot) (pushed bool, err error)

Jump to

Keyboard shortcuts

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