Documentation ¶
Overview ¶
Copyright 2024 Daytona Platforms Inc. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func GetBuildLogsDir() (string, error)
- func GetCachedBuild(build *Build, builds []*Build) *buildconfig.CachedBuild
- func GetRunnerConfigDir() (string, error)
- func IsBuildNotFound(err error) bool
- func Save(c Config) error
- type Build
- type BuildOutcome
- type BuildProcessConfig
- type BuildRunner
- type BuildRunnerInstanceConfig
- type BuildState
- type Builder
- type BuilderFactory
- type BuilderFactoryConfig
- type Config
- type CronScheduler
- type DevcontainerBuilder
- type Filter
- type GitProviderStore
- type IBuilder
- type IBuilderFactory
- type Store
Constants ¶
View Source
const DEFAULT_POLL_INTERVAL = "*/10 * * * * *"
TODO: add lock when running interval func 10 second interval
Variables ¶
View Source
var (
ErrBuildNotFound = errors.New("build not found")
)
Functions ¶
func GetBuildLogsDir ¶ added in v0.26.0
func GetCachedBuild ¶ added in v0.26.0
func GetCachedBuild(build *Build, builds []*Build) *buildconfig.CachedBuild
func GetRunnerConfigDir ¶ added in v0.26.0
func IsBuildNotFound ¶
Types ¶
type Build ¶ added in v0.25.0
type Build struct { Id string `json:"id" validate:"required"` State BuildState `json:"state" validate:"required"` Image *string `json:"image" validate:"optional"` User *string `json:"user" validate:"optional"` ContainerConfig containerconfig.ContainerConfig `json:"containerConfig" validate:"required"` BuildConfig *buildconfig.BuildConfig `json:"buildConfig" validate:"optional"` Repository *gitprovider.GitRepository `json:"repository" validate:"required"` EnvVars map[string]string `json:"envVars" validate:"required"` PrebuildId string `json:"prebuildId" validate:"required"` CreatedAt time.Time `json:"createdAt" validate:"required"` UpdatedAt time.Time `json:"updatedAt" validate:"required"` } // @name Build
func (*Build) GetBuildHash ¶ added in v0.26.0
GetBuildHash returns a SHA-256 hash of the build's configuration, repository branch and environment variables.
type BuildOutcome ¶
type BuildProcessConfig ¶ added in v0.26.0
type BuildRunner ¶ added in v0.25.0
type BuildRunner struct { Id string // contains filtered or unexported fields }
func NewBuildRunner ¶ added in v0.25.0
func NewBuildRunner(config BuildRunnerInstanceConfig) *BuildRunner
func (*BuildRunner) DeleteBuilds ¶ added in v0.26.0
func (r *BuildRunner) DeleteBuilds()
func (*BuildRunner) RunBuildProcess ¶ added in v0.25.0
func (r *BuildRunner) RunBuildProcess(config BuildProcessConfig)
func (*BuildRunner) RunBuilds ¶ added in v0.26.0
func (r *BuildRunner) RunBuilds()
func (*BuildRunner) Start ¶ added in v0.25.0
func (r *BuildRunner) Start() error
func (*BuildRunner) Stop ¶ added in v0.25.0
func (r *BuildRunner) Stop()
type BuildRunnerInstanceConfig ¶ added in v0.25.0
type BuildRunnerInstanceConfig struct { Interval string Scheduler scheduler.IScheduler BuildRunnerId string ContainerRegistry *containerregistry.ContainerRegistry GitProviderStore GitProviderStore BuildStore Store BuilderFactory IBuilderFactory LoggerFactory logs.LoggerFactory BasePath string TelemetryEnabled bool TelemetryService telemetry.TelemetryService }
type BuildState ¶ added in v0.25.0
type BuildState string
const ( BuildStatePendingRun BuildState = "pending-run" BuildStateRunning BuildState = "running" BuildStateError BuildState = "error" BuildStateSuccess BuildState = "success" BuildStatePublished BuildState = "published" BuildStatePendingDelete BuildState = "pending-delete" BuildStatePendingForcedDelete BuildState = "pending-forced-delete" BuildStateDeleting BuildState = "deleting" )
type BuilderFactory ¶
type BuilderFactory struct {
// contains filtered or unexported fields
}
func (*BuilderFactory) CheckExistingBuild ¶
func (f *BuilderFactory) CheckExistingBuild(b Build) (*Build, error)
type BuilderFactoryConfig ¶
type BuilderFactoryConfig struct { Image string ContainerRegistry *containerregistry.ContainerRegistry BuildStore Store BuildImageNamespace string // Namespace to be used when tagging and pushing the build image LoggerFactory logs.LoggerFactory DefaultProjectImage string DefaultProjectUser string }
type Config ¶ added in v0.25.0
type CronScheduler ¶ added in v0.25.0
type CronScheduler struct {
// contains filtered or unexported fields
}
CronScheduler is a wrapper around the cron library. It implements the IScheduler interface. It is used to schedule tasks at specific intervals. Wrapping the cron library is necessary to enable proper mocking while testing dependent code.
func NewCronScheduler ¶ added in v0.25.0
func NewCronScheduler() *CronScheduler
func (*CronScheduler) AddFunc ¶ added in v0.25.0
func (s *CronScheduler) AddFunc(interval string, cmd func()) error
func (*CronScheduler) Start ¶ added in v0.25.0
func (s *CronScheduler) Start()
func (*CronScheduler) Stop ¶ added in v0.25.0
func (s *CronScheduler) Stop()
type DevcontainerBuilder ¶
type DevcontainerBuilder struct { *Builder // contains filtered or unexported fields }
func (*DevcontainerBuilder) Build ¶
func (b *DevcontainerBuilder) Build(build Build) (string, string, error)
func (*DevcontainerBuilder) CleanUp ¶
func (b *DevcontainerBuilder) CleanUp() error
func (*DevcontainerBuilder) Publish ¶
func (b *DevcontainerBuilder) Publish(build Build) error
type Filter ¶ added in v0.26.0
type Filter struct { Id *string States *[]BuildState PrebuildIds *[]string GetNewest *bool BuildConfig *buildconfig.BuildConfig RepositoryUrl *string Branch *string EnvVars *map[string]string }
func (*Filter) PrebuildIdsToInterface ¶ added in v0.26.0
func (f *Filter) PrebuildIdsToInterface() []interface{}
func (*Filter) StatesToInterface ¶ added in v0.26.0
func (f *Filter) StatesToInterface() []interface{}
type GitProviderStore ¶ added in v0.26.0
type GitProviderStore interface {
ListConfigsForUrl(url string) ([]*gitprovider.GitProviderConfig, error)
}
type IBuilderFactory ¶
type IBuilderFactory interface { Create(build Build, projectDir string) (IBuilder, error) CheckExistingBuild(build Build) (*Build, error) }
func NewBuilderFactory ¶
func NewBuilderFactory(config BuilderFactoryConfig) IBuilderFactory
Source Files ¶
Click to show internal directories.
Click to hide internal directories.