Documentation ¶
Index ¶
- Constants
- func CreateIntegrationTarball() (string, error)
- func DeleteFromBucket(path string) error
- func FindDockerFiles(dockerfilesPath string) ([]string, error)
- func GetDockerImage(imageRepo, dockerfile string) string
- func GetKanikoImage(imageRepo, dockerfile string) string
- func GetVersionedKanikoImage(imageRepo, dockerfile string, version int) string
- func RunCommand(cmd *exec.Cmd, t *testing.T) []byte
- func RunCommandWithoutTest(cmd *exec.Cmd) ([]byte, error)
- func RunOnInterrupt(f func())
- func UploadFileToBucket(gcsBucket string, filePath string, gcsPath string) (string, error)
- type DockerFileBuilder
Constants ¶
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 ¶
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 ¶
DeleteFromBucket will remove the content at path. path should be the full path to a file in GCS.
func FindDockerFiles ¶
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 ¶
GetDockerImage constructs the name of the docker image that would be built with dockerfile if it was tagged with imageRepo.
func GetKanikoImage ¶
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
GetVersionedKanikoImage versions constructs the name of the kaniko image that would be built with the dockerfile and versions it for cache testing
func RunCommand ¶
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 ¶
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.
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.