helper

package
v0.0.0-...-1806480 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SERVER_HOST is a Env variable name
	SERVER_HOST           = "SERVER_HOST"
	DOCKER_IMAGE_LOG_FLAG = "layer"
)
View Source
const (
	// KUBERNETES is the cluster type of kubernetes.
	KUBERNETES = "kubernetes"
)

Variables

View Source
var (

	// ErrNoOutput is the error for no output file.
	ErrNoOutput = errors.New("event has no output file")
)

Functions

func DoPlanDeployCheck

func DoPlanDeployCheck(event *api.Event)

DoPlanDeployCheck uses for plan deploy state check.

func DoPlansDeploy

func DoPlansDeploy(bHasPublishSuccessful bool, event *api.Event, dmanager *docker.Manager) error

DoPlansDeploy is a wrapper of deploy to do some extra work by Plans information.

func DoYamlDeploy

func DoYamlDeploy(r *runner.Build, tree *parser.Tree, event *api.Event, dmanager *docker.Manager) error

DoYamlDeploy is a wrapper of deploy to do some extra work by yaml information.

func DoYamlDeployCheck

func DoYamlDeployCheck(event *api.Event, tree *parser.Tree)

DoYamlDeployCheck uses for yaml deploy state check.

func ExecBuild

func ExecBuild(cmanager *ci.Manager, r *runner.Build) (err error)

ExecBuild exec the publish steps Step1: Prebuild Step2: Build

func ExecDeploy

func ExecDeploy(event *api.Event, dmanager *docker.Manager,
	r *runner.Build, tree *parser.Tree) (err error)

ExecDeploy exec the deploy steps.

func ExecDeployCheck

func ExecDeployCheck(event *api.Event, tree *parser.Tree)

ExecDeployCheck keeps call console-web API to check deploy status of the version util timeout or error occurred or success. It will write finalStatus to DB.

func ExecIntegration

func ExecIntegration(cmanager *ci.Manager, r *runner.Build) (err error)

ExecIntegration exec the integration steps Step1: set up service network Step2: integration Step3: tear down service network

func ExecPublish

func ExecPublish(cmanager *ci.Manager, r *runner.Build) (err error)

ExecPublish exec the publish steps Step1: Push images Step2: Post build

func InvokeCheckDeployStateAPI

func InvokeCheckDeployStateAPI(app appVersionInfo, endpoint string) error

InvokeCheckDeployStateAPI func call caicloud api to check whether the updating is successful.

func InvokeCheckDeployStateK8sAPI

func InvokeCheckDeployStateK8sAPI(app appVersionInfo) error

InvokeCheckDeployStateK8sAPI func call k8s api to check whether the updating is successful.

func InvokeUpdateImageAPI

func InvokeUpdateImageAPI(userID, applicationName, clusterName, partitionName,
	containerName, imageName, endpoint string) error

InvokeUpdateImageAPI used for call api to updape application in cluster.

func InvokeUpdateImageK8sAPI

func InvokeUpdateImageK8sAPI(deploymentName, namespaceName, containerName,
	imageName, host, token string) error

InvokeUpdateImageK8sAPI invokes k8s api to update the depolyment.

func NewClientWithToken

func NewClientWithToken(host, token string) (*clientset.Clientset, error)

NewClientWithToken creates a new kubernetes client using BearerToken.

func Publish

func Publish(event *api.Event, dmanager *docker.Manager) error

Publish is an async handler for build and push the image to private registry.

func PushLogToCyclone

func PushLogToCyclone(event *api.Event) error

PushLogToCyclone would push the log to cyclone.

Types

type Application

type Application struct {
	Deployment       k8s_ext_api.Deployment            `json:"deployment,omitempty"`
	Service          k8s_core_api.Service              `json:"service,omitempty"`
	DeleteOptions    k8s_core_api.DeleteOptions        `json:"deleteOptions,omitempty"`
	Pods             k8s_core_api.PodList              `json:"pods,omitempty"`
	Nodes            k8s_core_api.NodeList             `json:"nodes,omitempty"`
	PodEvents        map[string]k8s_core_api.EventList `json:"podEvents,omitempty"`
	DeploymentEvents k8s_core_api.EventList            `json:"deploymentEvents,omitempty"`
	ReplicaSetEvents k8s_core_api.EventList            `json:"replicaSetEvents,omitempty"`

	AutoProvisionPVC map[string]k8s_core_api.PersistentVolumeClaim `json:"autoProvisionPVC,omitempty"`
}

Application is the type for k8s deployment.

type Result

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

Result is the type for result.

Jump to

Keyboard shortcuts

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