Documentation ¶
Overview ¶
There are n build workers, which are started at the start of mvoCI. They execute BuildWorker. When a new build object is spawned into the build queue / channel, it is fetched (from git repo), the buildscript is placed in the folder and executed with bash. Then the directory is zipped and later removed.
Two builds cannot be ongoing on the same repo at the same time.
Index ¶
- Variables
- func BuildHookedFromSecret3(db *gorm.DB, secret string, branch string, sha string) uint
- func BuildNow(r core.Repository, db *gorm.DB) uint
- func BuildRelease(db *gorm.DB, r core.Repository, branch string, sha string, author string, ...) uint
- func BuildSpecific2(db *gorm.DB, r core.Repository, branch string, sha string, author string, ...) uint
- func BuildSpecific3(db *gorm.DB, r core.Repository, branch string, sha string, u core.User) uint
- func BuildWorker()
- func EnqueueBuild(b core.Build) error
- func FindBuildScript(db *gorm.DB, r core.Repository, event string) (core.BuildScript, error)
- func ReBuild(b core.Build, db *gorm.DB) uint
- func SetupWorkerThreads(cfg *core.Config, db *gorm.DB)
- func WorkerGoBuild(b *core.Build, log *mockerBuilder) (*mockerBuilder, bool)
- func WorkerGoCleanup(b *core.Build, log *mockerBuilder) (*mockerBuilder, bool)
- func WorkerGoGet(b *core.Build) (*mockerBuilder, bool)
- func WorkerGoZip(b *core.Build, log *mockerBuilder) (*mockerBuilder, bool)
- func WorkerPushRelease(b *core.Build, log *mockerBuilder) (*mockerBuilder, bool)
- type BuilderConfig
Constants ¶
This section is empty.
Variables ¶
var InChannel chan core.Build
channel / build queue for communication with the build workers
var Workers map[int]core.Thread
thread identifiers to the worker threads
Functions ¶
func BuildHookedFromSecret3 ¶
build a repo given the secret provided by a version control service in its hook message
func BuildNow ¶
func BuildNow(r core.Repository, db *gorm.DB) uint
build a repository now (the latest commit, default branch)
func BuildRelease ¶
func BuildRelease( db *gorm.DB, r core.Repository, branch string, sha string, author string, url string, message string, event string, api string, apiUrl string) uint
Build a release of a given repository
func BuildSpecific2 ¶
func BuildSpecific2(db *gorm.DB, r core.Repository, branch string, sha string, author string, url string, message string, event string) uint
build a specific repo, branch and commit, already having found out the commit-message, commit-url and build-event (most likely hooked)
func BuildSpecific3 ¶
build a specific repo, branch and commit
func BuildWorker ¶
func BuildWorker()
worker function: loop indefinitely and retrieve a new build from the build queue and build it.
func EnqueueBuild ¶
enqueue the build into the build-queue (channel)
func FindBuildScript ¶
func FindBuildScript(db *gorm.DB, r core.Repository, event string) (core.BuildScript, error)
helper function for finding the corrct build script given the event we just received (release or debug atm)
func SetupWorkerThreads ¶
sets up the worker threads in the given quantitiy
func WorkerGoBuild ¶
Build the repo by executing every line of the build script
func WorkerGoCleanup ¶
removes the repo directory
func WorkerGoGet ¶
starts building a build, i.e. clone the repository, get the correct branch and commit, and calling every line of the build-script (WorkerGoBuild) if this all succeeds: set the status to "finished", "failed" otherwiese.
func WorkerGoZip ¶
Zips the repo directory with the builds
func WorkerPushRelease ¶
atm for gitea we can push release builds to the code server using OAuth2 authentication (set-up beforehand by the user)
Types ¶
type BuilderConfig ¶
type BuilderConfig struct {
// contains filtered or unexported fields
}
structure for storing a reference to the database and the global config