jib

package
v2.11.1 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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MinimumJibGradleVersion = "1.4.0"

Skaffold-Jib depends on functionality introduced with Jib-Gradle 1.4.0

View Source
const MinimumJibGradleVersionForCrossPlatform = "3.2.0"
View Source
const MinimumJibGradleVersionForSync = "2.0.0"
View Source
const MinimumJibMavenVersion = "1.4.0"

Skaffold-Jib depends on functionality introduced with Jib-Maven 1.4.0

View Source
const MinimumJibMavenVersionForCrossPlatform = "3.2.0"
View Source
const MinimumJibMavenVersionForSync = "2.0.0"

Variables

View Source
var GetSyncDiff = getSyncDiff
View Source
var GradleCommand = util.CommandWrapper{Executable: "gradle", Wrapper: "gradlew"}

GradleCommand stores Gradle executable and wrapper name

View Source
var InitSync = initSync
View Source
var (
	// JVMFound is replaceable for testing
	JVMFound = jvmFound
)
View Source
var MavenCommand = util.CommandWrapper{Executable: "mvn", Wrapper: "mvnw"}

MavenCommand stores Maven executable and wrapper name

View Source
var (
	Validate = validate
)

For testing

Functions

func GenerateGradleBuildArgs

func GenerateGradleBuildArgs(task, imageName string, a *latest.JibArtifact, platforms platform.Matcher, skipTests, pushImages bool, deps []*latest.ArtifactDependency, r ArtifactResolver, insecureRegistries map[string]bool, showColors bool) []string

GenerateGradleBuildArgs generates the arguments to Gradle for building the project as an image.

func GenerateMavenBuildArgs

func GenerateMavenBuildArgs(goal, imageName string, a *latest.JibArtifact, platforms platform.Matcher, skipTests, pushImages bool, deps []*latest.ArtifactDependency, r ArtifactResolver, insecureRegistries map[string]bool, showColors bool) []string

GenerateMavenBuildArgs generates the arguments to Maven for building the project as an image.

func GetBuildDefinitions

func GetBuildDefinitions(workspace string, a *latest.JibArtifact) []string

func GetDependencies

func GetDependencies(ctx context.Context, workspace string, artifact *latest.JibArtifact) ([]string, error)

GetDependencies returns a list of files to watch for changes to rebuild

func PluginName

func PluginName(t PluginType) string

Name provides a human-oriented label for a plugin type.

Types

type ArtifactConfig

type ArtifactConfig struct {
	BuilderName string `json:"-"`
	Image       string `json:"image,omitempty"`
	File        string `json:"path,omitempty"`
	Project     string `json:"project,omitempty"`
}

ArtifactConfig holds information about a Jib project

func (ArtifactConfig) ArtifactType

func (c ArtifactConfig) ArtifactType(_ string) latest.ArtifactType

ArtifactType returns the type of the artifact to be built.

func (ArtifactConfig) ConfiguredImage

func (c ArtifactConfig) ConfiguredImage() string

ConfiguredImage returns the target image configured by the builder, or empty string if no image is configured

func (ArtifactConfig) Describe

func (c ArtifactConfig) Describe() string

Describe returns the initBuilder's string representation, used when prompting the user to choose a builder.

func (ArtifactConfig) Name

func (c ArtifactConfig) Name() string

Name returns the name of the builder

func (ArtifactConfig) Path

func (c ArtifactConfig) Path() string

Path returns the path to the build definition

type ArtifactResolver

type ArtifactResolver interface {
	GetImageTag(imageName string) (string, bool)
}

ArtifactResolver provides an interface to resolve built artifact tags by image name.

type Builder

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

Builder is a builder for jib artifacts

func NewArtifactBuilder

func NewArtifactBuilder(localDocker docker.LocalDaemon, cfg docker.Config, pushImages, skipTests bool, r ArtifactResolver) *Builder

NewArtifactBuilder returns a new customjib artifact builder

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, out io.Writer, artifact *latest.Artifact, tag string, platforms platform.Matcher) (string, error)

Build builds an artifact with Jib.

func (*Builder) SupportedPlatforms

func (b *Builder) SupportedPlatforms() platform.Matcher

type Config

type Config interface {
	docker.Config

	SkipTests() bool
}

type JSONSyncEntry

type JSONSyncEntry struct {
	Src  string `json:"src"`
	Dest string `json:"dest"`
}

type JSONSyncMap

type JSONSyncMap struct {
	Direct    []JSONSyncEntry `json:"direct"`
	Generated []JSONSyncEntry `json:"generated"`
}

type PluginType

type PluginType string

PluginType defines the different supported Jib plugins.

const (
	JibMaven  PluginType = "maven"
	JibGradle PluginType = "gradle"
)

func DeterminePluginType

func DeterminePluginType(ctx context.Context, workspace string, artifact *latest.JibArtifact) (PluginType, error)

DeterminePluginType tries to determine the Jib plugin type for the given artifact.

func (PluginType) IsKnown

func (t PluginType) IsKnown() bool

IsKnown checks that the num value is a known value (vs 0 or an unknown value).

type SyncEntry

type SyncEntry struct {
	Dest     []string
	FileTime time.Time
	IsDirect bool
}

type SyncMap

type SyncMap map[string]SyncEntry

Jump to

Keyboard shortcuts

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