gsutil

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package gsutil provides helper functions for running gsutil commands with Docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerFlags

type DockerFlags struct {
	Workvol string
	Workdir string
	Tmpdir  string
}

DockerFlags holds information relevant to docker run invocations.

type Helper

type Helper interface {
	VerifyBucket(ctx context.Context, bucket string) error
	UploadArtifacts(ctx context.Context, flags DockerFlags, src, dest string) ([]*pb.ArtifactResult, error)
	UploadArtifactsManifest(ctx context.Context, flags DockerFlags, manifest, bucket string, results []*pb.ArtifactResult) (string, error)
}

Helper is a mockable interface for running gsutil commands in docker.

type RealHelper

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

RealHelper provides helper functions that actual run gsutil commands in docker.

func New

func New(r runner.Runner, fs afero.Fs, logger logger.Logger) RealHelper

New returns a new RealHelper struct.

func (RealHelper) UploadArtifacts

func (g RealHelper) UploadArtifacts(ctx context.Context, flags DockerFlags, src, dest string) ([]*pb.ArtifactResult, error)

UploadArtifacts copies artifacts from the project workspace source to a GCS bucket. Returns the GCS path of the artifact manifest file and the number of artifacts uploaded.

func (RealHelper) UploadArtifactsManifest

func (g RealHelper) UploadArtifactsManifest(ctx context.Context, flags DockerFlags, manifest, bucket string, results []*pb.ArtifactResult) (string, error)

func (RealHelper) VerifyBucket

func (g RealHelper) VerifyBucket(ctx context.Context, bucket string) error

VerifyBucket returns nil if the bucket exists, otherwise an error.

Jump to

Keyboard shortcuts

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