jib

package
v1.35.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 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 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 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 added in v1.2.0

func GenerateGradleBuildArgs(task string, imageName string, a *latestV1.JibArtifact, skipTests, pushImages bool, deps []*latestV1.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 added in v1.2.0

func GenerateMavenBuildArgs(goal string, imageName string, a *latestV1.JibArtifact, skipTests, pushImages bool, deps []*latestV1.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 added in v1.2.0

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

func GetDependencies

func GetDependencies(ctx context.Context, workspace string, artifact *latestV1.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 added in v1.2.0

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 added in v1.6.0

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

ArtifactType returns the type of the artifact to be built.

func (ArtifactConfig) ConfiguredImage added in v1.2.0

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 added in v1.2.0

func (c ArtifactConfig) Describe() string

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

func (ArtifactConfig) Name added in v1.2.0

func (c ArtifactConfig) Name() string

Name returns the name of the builder

func (ArtifactConfig) Path added in v1.2.0

func (c ArtifactConfig) Path() string

Path returns the path to the build definition

type ArtifactResolver added in v1.7.1

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 *latestV1.Artifact, tag string) (string, error)

Build builds an artifact with Jib.

type Config added in v1.7.1

type Config interface {
	docker.Config

	SkipTests() bool
}

type JSONSyncEntry added in v1.3.0

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

type JSONSyncMap added in v1.3.0

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 *latestV1.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 added in v1.3.0

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

type SyncMap added in v1.3.0

type SyncMap map[string]SyncEntry

Jump to

Keyboard shortcuts

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