controllers

package
v0.0.0-...-2bc3891 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2015 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*revel.Controller
}

App struct

func (App) Index

func (c App) Index() revel.Result

Index only redirect to projects index

type Build

type Build struct {
	ID                   bson.ObjectId `bson:"_id,omitempty"`
	Date                 time.Time
	StartDate            time.Time
	LastUpdated          time.Time
	ProjectToBuild       Project
	TargetSys            string
	State                State
	Commit               string
	UpdateWorkerDuration time.Duration
	Deploy               bool
	GitCommitID          string
}

Build represent a build

func (*Build) CreateOutputTar

func (b *Build) CreateOutputTar() error

CreateOutputTar the entire output folder

func (*Build) Duration

func (b *Build) Duration() time.Duration

Duration return diff between date and updatedDate

func (*Build) IsDeployable

func (b *Build) IsDeployable() bool

IsDeployable return if the build can be deployed

func (*Build) IsDownloadable

func (b *Build) IsDownloadable() bool

IsDownloadable return true if downloadable

func (*Build) IsRetryable

func (b *Build) IsRetryable() bool

IsRetryable return true if we can retry a failed build

type BuildController

type BuildController struct {
	*revel.Controller
}

BuildController Controller

func (BuildController) Deploy

func (c BuildController) Deploy() revel.Result

Deploy the built package

func (BuildController) Detail

func (c BuildController) Detail() revel.Result

Detail of a build page

func (BuildController) Download

func (c BuildController) Download() revel.Result

Download the build result

func (BuildController) Index

func (c BuildController) Index() revel.Result

Index page

func (BuildController) Retry

func (c BuildController) Retry() revel.Result

Retry a failed build

type BuildManager

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

BuildManager is the build manager

func BMInstance

func BMInstance() *BuildManager

BMInstance Return the instance of build manager

func (*BuildManager) BuildMaintenance

func (b *BuildManager) BuildMaintenance() error

BuildMaintenance should be called in case build were not updated to there final state (e.g at start since no build should be in created, init or building state)

func (*BuildManager) CreateOrReturnStatusBuild

func (b *BuildManager) CreateOrReturnStatusBuild(projectName string, sys string, commit string, deploy bool) (*Build, error)

CreateOrReturnStatusBuild create or return status of requested build

func (*BuildManager) Deploy

func (b *BuildManager) Deploy(build *Build)

Deploy the built package

func (*BuildManager) GetBuildByID

func (b *BuildManager) GetBuildByID(id string) (*Build, error)

GetBuildByID return a build by it's id

func (*BuildManager) GetBuildsByProjects

func (b *BuildManager) GetBuildsByProjects(projectName string) ([]Build, error)

GetBuildsByProjects get list of projects builds

func (*BuildManager) RetryBuild

func (b *BuildManager) RetryBuild(build *Build)

RetryBuild that failed

func (*BuildManager) UpdateBuild

func (b *BuildManager) UpdateBuild(build *Build) error

UpdateBuild in DB

type DockerWorker

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

DockerWorker Controller implementing Worker interface

func (DockerWorker) Run

func (d DockerWorker) Run()

Run the DockerWorker

type GerritManager

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

GerritManager for fetching changes

func (*GerritManager) GetOpenChanges

func (g *GerritManager) GetOpenChanges() ([]string, error)

GetOpenChanges return open gerrit patchset for project TODO: Use the Mergable and title property ??

func (*GerritManager) Init

func (g *GerritManager) Init(p *Project)

Init function

type MailManager

type MailManager struct {
}

MailManager is the mail manager

func MMInstance

func MMInstance() *MailManager

MMInstance Return the instance of mailer manager

func (*MailManager) SendBuildFailedMail

func (m *MailManager) SendBuildFailedMail(b Build)

SendBuildFailedMail send a mail in case of failed build

type Project

type Project struct {
	Name                  string
	Configuration         ProjectConfiguration
	ReviewManagerInstance ReviewManager `bson:"-"`
}

Project struct

func (*Project) GetHeadCommitID

func (p *Project) GetHeadCommitID() string

GetHeadCommitID return the head commit id

func (*Project) Init

func (p *Project) Init(dir os.FileInfo) error

Init configuration

func (*Project) Reload

func (p *Project) Reload() error

Reload configuration

type ProjectConfiguration

type ProjectConfiguration struct {
	BuildType              string
	BuildInstructions      map[string][]string
	UpdateInstructions     map[string][]string
	ReviewType             string
	ReviewAddress          string
	Package                map[string]string
	ReloadProjectCmd       []string
	AutoDeploySchedule     map[string]string
	DeployScript           string
	NotificationMailAdress []string
}

ProjectConfiguration struct

type ProjectsController

type ProjectsController struct {
	*revel.Controller
}

ProjectsController struct

func (ProjectsController) Build

func (pc ProjectsController) Build() revel.Result

Build a project

func (ProjectsController) Index

func (pc ProjectsController) Index() revel.Result

Index Page

type ProjectsManager

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

ProjectsManager represent the project we want to compile

func PMInstance

func PMInstance() *ProjectsManager

PMInstance Return the instance

func (*ProjectsManager) GetProjectByName

func (pm *ProjectsManager) GetProjectByName(name string) Project

GetProjectByName return a project by name

func (*ProjectsManager) GetProjectsList

func (pm *ProjectsManager) GetProjectsList() []Project

GetProjectsList return list of projects

type ReviewManager

type ReviewManager interface {
	Init(p *Project)
	GetOpenChanges() ([]string, error)
}

ReviewManager interface

type State

type State int

State enum

const (
	Created  State = iota //0
	Init                  //1
	Building              //2
	Fail                  //3

	Success         //4
	FallbackSuccess //5
)

State enum *Keep this ordered*

func (State) String

func (s State) String() string

type Worker

type Worker interface {
	Run()
}

Worker interface

type WorkerManager

type WorkerManager struct {
}

WorkerManager singleton

func WMInstance

func WMInstance() *WorkerManager

WMInstance Return the instance

func (*WorkerManager) Build

func (w *WorkerManager) Build(build *Build) error

Build Launch a build Build queue is restricted by jobs.pool = 4 in app.conf (FIFO)

Jump to

Keyboard shortcuts

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