builder

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContextDir is the directory used to package the container.
	ContextDir = "context"
	// DeploymentDir is the directory used in the runtime application to deploy the artifacts.
	DeploymentDir = "/deployments"
	// DependenciesDir is the directory used to store required dependencies.
	DependenciesDir = "dependencies"
)
View Source
const (
	// InitPhase --.
	InitPhase int32 = 0
	// ProjectGenerationPhase --.
	ProjectGenerationPhase int32 = 10
	// ProjectBuildPhase --.
	ProjectBuildPhase int32 = 20
	// ApplicationPackagePhase --.
	ApplicationPackagePhase int32 = 30
	// ApplicationPublishPhase --.
	ApplicationPublishPhase int32 = 40
)

Variables

View Source
var Image = imageSteps{
	IncrementalImageContext: NewStep(ApplicationPackagePhase, incrementalImageContext),
	NativeImageContext:      NewStep(ApplicationPackagePhase, nativeImageContext),
	StandardImageContext:    NewStep(ApplicationPackagePhase, standardImageContext),
	ExecutableDockerfile:    NewStep(ApplicationPackagePhase+1, executableDockerfile),
	JvmDockerfile:           NewStep(ApplicationPackagePhase+1, jvmDockerfile),
}

Image used to export the steps available on an Image building process.

View Source
var Project = projectSteps{
	CleanUpBuildDir:         NewStep(ProjectGenerationPhase-1, cleanUpBuildDir),
	GenerateJavaKeystore:    NewStep(ProjectGenerationPhase, generateJavaKeystore),
	GenerateProjectSettings: NewStep(ProjectGenerationPhase+1, generateProjectSettings),
	InjectDependencies:      NewStep(ProjectGenerationPhase+2, injectDependencies),
	SanitizeDependencies:    NewStep(ProjectGenerationPhase+3, sanitizeDependencies),
	InjectProfiles:          NewStep(ProjectGenerationPhase+4, injectProfiles),
}
View Source
var Quarkus = quarkusSteps{
	LoadCamelQuarkusCatalog:    NewStep(InitPhase, loadCamelQuarkusCatalog),
	GenerateQuarkusProject:     NewStep(ProjectGenerationPhase, generateQuarkusProject),
	PrepareProjectWithSources:  NewStep(ProjectBuildPhase-1, prepareProjectWithSources),
	BuildQuarkusRunner:         NewStep(ProjectBuildPhase, buildQuarkusRunner),
	ComputeQuarkusDependencies: NewStep(ProjectBuildPhase+1, computeQuarkusDependencies),
}

Functions

func BuildQuarkusRunnerCommon

func BuildQuarkusRunnerCommon(ctx context.Context, mc maven.Context, project maven.Project, applicationProperties map[string]string) error

func ProcessQuarkusTransitiveDependencies

func ProcessQuarkusTransitiveDependencies(mc maven.Context) ([]v1.Artifact, error)

func StepIDsFor

func StepIDsFor(steps ...Step) []string

Types

type Build

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

func (*Build) Task

func (b *Build) Task(task v1.Task) Task

Task convert the task in a routine task which can be executed inside operator.

func (*Build) TaskByName

func (b *Build) TaskByName(name string) Task

TaskByName return the task identified by the name parameter.

type Builder

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

func New

func New(c client.Client) *Builder

func (*Builder) Build

func (b *Builder) Build(build *v1.Build) *Build

Build convert the Build CR in a struct that can be executable as an operator routine.

type NativeAdapter added in v2.1.0

type NativeAdapter struct {
}

NativeAdapter used for Camel Quarkus runtime < 3.5.0.

func (*NativeAdapter) BuildCommands added in v2.1.0

func (n *NativeAdapter) BuildCommands() string

BuildCommands -- .

func (*NativeAdapter) Directory added in v2.1.0

func (n *NativeAdapter) Directory() string

Directory -- .

func (*NativeAdapter) NativeMavenProperty added in v2.1.0

func (n *NativeAdapter) NativeMavenProperty() string

NativeMavenProperty -- .

func (*NativeAdapter) TargetDirectory added in v2.1.0

func (n *NativeAdapter) TargetDirectory(ctxPath, runner string) string

TargetDirectory -- .

type NativeSourcesAdapter added in v2.1.0

type NativeSourcesAdapter struct {
}

NativeSourcesAdapter used for Camel Quarkus runtime >= 3.5.0.

func (*NativeSourcesAdapter) BuildCommands added in v2.1.0

func (n *NativeSourcesAdapter) BuildCommands() string

BuildCommands -- .

func (*NativeSourcesAdapter) Directory added in v2.1.0

func (n *NativeSourcesAdapter) Directory() string

Directory -- .

func (*NativeSourcesAdapter) NativeMavenProperty added in v2.1.0

func (n *NativeSourcesAdapter) NativeMavenProperty() string

NativeMavenProperty -- .

func (*NativeSourcesAdapter) TargetDirectory added in v2.1.0

func (n *NativeSourcesAdapter) TargetDirectory(ctxPath, runner string) string

TargetDirectory -- .

type QuarkusRuntimeNativeAdapter added in v2.1.0

type QuarkusRuntimeNativeAdapter interface {
	// The commands used to build a native application
	BuildCommands() string
	// The directory where to execute the command
	Directory() string
	// The directory where to expect the native compiled artifact
	TargetDirectory(ctxPath, runner string) string
	// The parameter to use for the maven project
	NativeMavenProperty() string
}

QuarkusRuntimeNativeAdapter is used to get the proper Quarkus native configuration which may be different in Camel Quarkus version. It is known that before Camel Quarkus 3.5 there was no support to native-source, and using this interface will adapt the configuration to build natively according each version expected configuration.

func QuarkusRuntimeSupport added in v2.1.0

func QuarkusRuntimeSupport(version string) QuarkusRuntimeNativeAdapter

QuarkusRuntimeSupport is used to get the proper native configuration based on the Camel Quarkus version.

type Step

type Step interface {
	ID() string
	Phase() int32
	// contains filtered or unexported methods
}

func NewStep

func NewStep(phase int32, task StepTask) Step

func StepsFrom

func StepsFrom(ids ...string) ([]Step, error)

type StepTask

type StepTask func(*builderContext) error

type Task

type Task interface {
	Do(ctx context.Context) v1.BuildStatus
}

Jump to

Keyboard shortcuts

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