integration

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExecutorImage is the name of the kaniko executor image
	ExecutorImage = "executor-image"
	//WarmerImage is the name of the kaniko cache warmer image
	WarmerImage = "warmer-image"
)

Variables

This section is empty.

Functions

func CreateIntegrationTarball

func CreateIntegrationTarball() (string, error)

CreateIntegrationTarball will take the contents of the integration directory and write them to a tarball in a temmporary dir. It will return a path to the tarball.

func DeleteFromBucket

func DeleteFromBucket(path string) error

DeleteFromBucket will remove the content at path. path should be the full path to a file in GCS.

func FindDockerFiles

func FindDockerFiles(dockerfilesPath string) ([]string, error)

FindDockerFiles will look for test docker files in the directory dockerfilesPath. These files must start with `Dockerfile_test`. If the file is one we are intentionally skipping, it will not be included in the returned list.

func GetDockerImage

func GetDockerImage(imageRepo, dockerfile string) string

GetDockerImage constructs the name of the docker image that would be built with dockerfile if it was tagged with imageRepo.

func GetKanikoImage

func GetKanikoImage(imageRepo, dockerfile string) string

GetKanikoImage constructs the name of the kaniko image that would be built with dockerfile if it was tagged with imageRepo.

func GetVersionedKanikoImage added in v0.4.0

func GetVersionedKanikoImage(imageRepo, dockerfile string, version int) string

GetVersionedKanikoImage versions constructs the name of the kaniko image that would be built with the dockerfile and versions it for cache testing

func RunCommand

func RunCommand(cmd *exec.Cmd, t *testing.T) []byte

RunCommand will run cmd and if it fails will output relevant info for debugging before it fails. It must be run within the context of a test t and if the command fails, it will the test. Returns the output from the command.

func RunCommandWithoutTest

func RunCommandWithoutTest(cmd *exec.Cmd) ([]byte, error)

RunCommandWithoutTest will run cmd and if it fails will output relevant info for debugging before returning an error. It can be run outside the context of a test.

func RunOnInterrupt

func RunOnInterrupt(f func())

RunOnInterrupt will execute the function f if execution is interrupted with the interrupt signal.

func UploadFileToBucket

func UploadFileToBucket(gcsBucket string, filePath string, gcsPath string) (string, error)

UploadFileToBucket will upload the at filePath to gcsBucket. It will return the path of the file in gcsBucket.

Types

type DockerFileBuilder

type DockerFileBuilder struct {
	// Holds all available docker files and whether or not they've been built
	FilesBuilt           map[string]bool
	DockerfilesToIgnore  map[string]struct{}
	TestCacheDockerfiles map[string]struct{}
}

DockerFileBuilder knows how to build docker files using both Kaniko and Docker and keeps track of which files have been built.

func NewDockerFileBuilder

func NewDockerFileBuilder(dockerfiles []string) *DockerFileBuilder

NewDockerFileBuilder will create a DockerFileBuilder initialized with dockerfiles, which it will assume are all as yet unbuilt.

func (*DockerFileBuilder) BuildImage

func (d *DockerFileBuilder) BuildImage(imageRepo, gcsBucket, dockerfilesPath, dockerfile string) error

BuildImage will build dockerfile (located at dockerfilesPath) using both kaniko and docker. The resulting image will be tagged with imageRepo. If the dockerfile will be built with context (i.e. it is in `buildContextTests`) the context will be pulled from gcsBucket.

Jump to

Keyboard shortcuts

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