Documentation
¶
Index ¶
- func Build(ctx context.Context, builder *Builder) error
- func NewPackSyncer(pack pack.PackageService, apps app.Applications, repo string) *packSyncer
- type Builder
- func (b *Builder) Close() error
- func (b *Builder) CreateApplication(data io.ReadCloser) (*app.Application, error)
- func (b *Builder) GenerateInstaller(application app.Application) (io.ReadCloser, error)
- func (b *Builder) Locator() loc.Locator
- func (b *Builder) SelectRuntime() (*semver.Version, error)
- func (b *Builder) SyncPackageCache(runtimeVersion *semver.Version) error
- func (b *Builder) Vendor(ctx context.Context, dir string) (io.ReadCloser, error)
- func (b *Builder) WriteInstaller(data io.ReadCloser) error
- type Config
- type Generator
- type GetRepositoryFunc
- type NewSyncerFunc
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPackSyncer ¶
func NewPackSyncer(pack pack.PackageService, apps app.Applications, repo string) *packSyncer
NewPackSyncer creates a new syncer from provided pack and apps services
Types ¶
type Builder ¶
type Builder struct {
// Config is the builder configuration
Config
// Env is the local build environment
Env *localenv.LocalEnvironment
// Manifest is the parsed manifest of the application being built
Manifest schema.Manifest
// Dir is the directory where build-related data is stored
Dir string
// Backend is the local backend
Backend storage.Backend
// Packages is the layered package service with the local cache
// directory serving as a 'read' layer and the temporary directory
// as a 'read-write' layer
Packages pack.PackageService
// Apps is the application service based on the layered package service
Apps app.Applications
// contains filtered or unexported fields
}
Builder implements the installer builder
func (*Builder) CreateApplication ¶
func (b *Builder) CreateApplication(data io.ReadCloser) (*app.Application, error)
CreateApplication creates a Gravity application from the provided data in the local database
func (*Builder) GenerateInstaller ¶
func (b *Builder) GenerateInstaller(application app.Application) (io.ReadCloser, error)
GenerateInstaller generates an installer tarball for the specified application and returns its data as a stream
func (*Builder) SelectRuntime ¶
SelectRuntime picks an appropriate runtime for the application that's being built
func (*Builder) SyncPackageCache ¶
SyncPackageCache ensures that all system dependencies are present in the local cache directory
func (*Builder) Vendor ¶
Vendor vendors the application images in the provided directory and returns the compressed data stream with the application data
func (*Builder) WriteInstaller ¶
func (b *Builder) WriteInstaller(data io.ReadCloser) error
WriteInstaller writes the provided installer tarball data to disk
type Config ¶
type Config struct {
// Context is the build context
Context context.Context
// StateDir is the configured builder state directory
StateDir string
// Insecure disables client verification of the server TLS certificate chain
Insecure bool
// ManifestPath holds the path to the application manifest
ManifestPath string
// OutPath holds the path to the installer tarball to be output
OutPath string
// Overwrite indicates whether or not to overwrite an existing installer file
Overwrite bool
// Repository represents the source package repository
Repository string
// SkipVersionCheck allows to skip tele/runtime compatibility check
SkipVersionCheck bool
// VendorReq combines vendoring options
VendorReq service.VendorRequest
// Generator is used to generate installer
Generator Generator
// NewSyncer is used to initialize package cache syncer for the builder
NewSyncer NewSyncerFunc
// GetRepository is a function that returns package source repository
GetRepository GetRepositoryFunc
// FieldLogger is used for logging
logrus.FieldLogger
// Progress allows builder to report build progress
utils.Progress
// Silent suppresses all std output when set to true
Silent bool
// contains filtered or unexported fields
}
Config is the builder configuration
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults validates builder config and fills in defaults
type Generator ¶
type Generator interface {
// Generate generates an installer tarball for the specified application
// using the provided builder and returns its data as a stream
Generate(*Builder, app.Application) (io.ReadCloser, error)
}
Generator defines a method for generating standalone installers
type GetRepositoryFunc ¶
GetRepositoryFunc defines function that returns package source repository
type NewSyncerFunc ¶
NewSyncerFunc defines function that creates syncer for a builder
type Syncer ¶
type Syncer interface {
// Sync makes sure that local cache has all required dependencies for the
// selected runtime
Sync(*Builder, *semver.Version) error
// SelectRuntime picks an appropriate runtime for the application that's
// being built
SelectRuntime(*Builder) (*semver.Version, error)
}
Syncer synchronizes the local package cache from a (remote) repository