web

package
v0.0.0-...-dfe815e Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(bucket, project string) error

CreateBucket creates a new bucket on Google Storage.

func DownloadFile

func DownloadFile(file, url string) (int64, error)

DownloadFile downloads a file from a given url and saves it in the local filesystem.

func RollbackDeployment

func RollbackDeployment(namespace, name string, info ClusterInfo) error

RollbackDeployment reverts the deployment back to its previous state.

func StorageUpload

func StorageUpload(bucket, object, local string) (int64, error)

StorageUpload uploads a local file to Google Storage bucket.

func UnavailableReplicas

func UnavailableReplicas(namespace, name string, info ClusterInfo) (int32, error)

UnavailableReplicas returns the number of unavailable deployment instances for a given deployment.

func UpdateDeployment

func UpdateDeployment(namespace, name, container, docker string, info ClusterInfo) error

UpdateDeployment updates a deployment object by adding a new docker image value and triggering a rolling deployment in the process.

Types

type BuildResult

type BuildResult struct {
	ID     string
	Status BuildStatus
	LogURL string
}

BuildResult represents build info returned by build operations.

func CreateBuild

func CreateBuild(project, name, bucket, object string, tags []string) (BuildResult, error)

CreateBuild creates and starts a CloudBuild on GCP.

func GetBuild

func GetBuild(project, id string) (BuildResult, error)

GetBuild retrieves the latest build status for a given GCP Cloud Build.

type BuildStatus

type BuildStatus int

BuildStatus referes to Cloud Build status.

const (
	// UnknownBuildStatus refers to an edge case wherein the status is unknown.
	UnknownBuildStatus BuildStatus = iota
	// QueuedBuildStatus means the build is waiting in the queue to be processed.
	QueuedBuildStatus
	// WorkingBuildStatus means the build is in progress.
	WorkingBuildStatus
	// SuccessBuildStatus means the build has completed successfully.
	SuccessBuildStatus
	// FailureBuildStatus means the build ended because of user failure.
	FailureBuildStatus
	// InternalErrorBuildStatus means the build ended because of an error in the build system.
	InternalErrorBuildStatus
	// TimeoutBuildStatus means the build ended because it ran too long.
	TimeoutBuildStatus
	// CanceledBuildStatus means the build ended because a user has canceled it.
	CanceledBuildStatus
)

type ClusterInfo

type ClusterInfo struct {
	Username string
	Password string
	CAData   []byte
	KeyData  []byte
	CertData []byte
	Endpoint string
}

ClusterInfo contain auth data used to connect to Kubernetes.

func GetGKECluster

func GetGKECluster(project, zone, name string) (ClusterInfo, error)

GetGKECluster returns cluster config for a GKE cluster.

type LatestRelease

type LatestRelease struct {
	Version string
	ShaURL  string
	TarURL  string
}

LatestRelease represents the GitHub latest release asset download info.

func GetLatestRelease

func GetLatestRelease(shaFile, tarFile string) (LatestRelease, error)

GetLatestRelease returns the LatestRelease information.

Jump to

Keyboard shortcuts

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