Documentation ¶
Index ¶
- Constants
- Variables
- func DoPlanDeployCheck(event *api.Event)
- func DoPlansDeploy(bHasPublishSuccessful bool, event *api.Event, dmanager *docker.Manager) error
- func DoYamlDeploy(r *runner.Build, tree *parser.Tree, event *api.Event, dmanager *docker.Manager) error
- func DoYamlDeployCheck(event *api.Event, tree *parser.Tree)
- func ExecBuild(cmanager *ci.Manager, r *runner.Build) (err error)
- func ExecDeploy(event *api.Event, dmanager *docker.Manager, r *runner.Build, tree *parser.Tree) (err error)
- func ExecDeployCheck(event *api.Event, tree *parser.Tree)
- func ExecIntegration(cmanager *ci.Manager, r *runner.Build) (err error)
- func ExecPublish(cmanager *ci.Manager, r *runner.Build) (err error)
- func InvokeCheckDeployStateAPI(app appVersionInfo, endpoint string) error
- func InvokeCheckDeployStateK8sAPI(app appVersionInfo) error
- func InvokeUpdateImageAPI(...) error
- func InvokeUpdateImageK8sAPI(deploymentName, namespaceName, containerName, imageName, host, token string) error
- func NewClientWithToken(host, token string) (*clientset.Clientset, error)
- func Publish(event *api.Event, dmanager *docker.Manager) error
- func PushLogToCyclone(event *api.Event) error
- type Application
- type Result
Constants ¶
const ( // SERVER_HOST is a Env variable name SERVER_HOST = "SERVER_HOST" DOCKER_IMAGE_LOG_FLAG = "layer" )
const (
// KUBERNETES is the cluster type of kubernetes.
KUBERNETES = "kubernetes"
)
Variables ¶
var ( // ErrNoOutput is the error for no output file. ErrNoOutput = errors.New("event has no output file") )
Functions ¶
func DoPlanDeployCheck ¶
DoPlanDeployCheck uses for plan deploy state check.
func DoPlansDeploy ¶
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 ¶
DoYamlDeployCheck uses for yaml deploy state check.
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 ¶
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 ¶
ExecIntegration exec the integration steps Step1: set up service network Step2: integration Step3: tear down service network
func ExecPublish ¶
ExecPublish exec the publish steps Step1: Push images Step2: Post build
func InvokeCheckDeployStateAPI ¶
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 ¶
NewClientWithToken creates a new kubernetes client using BearerToken.
func PushLogToCyclone ¶
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.