本文整理汇总了Golang中github.com/megamsys/libgo/action.NewPipeline函数的典型用法代码示例。如果您正苦于以下问题:Golang NewPipeline函数的具体用法?Golang NewPipeline怎么用?Golang NewPipeline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewPipeline函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Destroy
func (p *oneProvisioner) Destroy(box *provision.Box, w io.Writer) error {
fmt.Fprintf(w, "\n--- destroying box (%s)\n", box.GetFullName())
args := runMachineActionsArgs{
box: box,
writer: w,
isDeploy: false,
machineStatus: provision.StatusDestroying,
provisioner: p,
}
actions := []*action.Action{
&updateStatusInRiak,
&destroyOldMachine,
&destroyOldRoute,
}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(args)
if err != nil {
fmt.Fprintf(w, "--- destroying box (%s)\n --> %s", box.GetFullName(), err)
return err
}
err = doneNotify(box, w, alerts.DESTROYED)
return nil
}
开发者ID:vijaykanthm28,项目名称:vertice,代码行数:26,代码来源:provisioner.go
示例2: deployPipeline
func (p *dockerProvisioner) deployPipeline(box *provision.Box, imageId string, w io.Writer) (string, error) {
fmt.Fprintf(w, "\n--- deploy box (%s, image:%s)\n", box.GetFullName(), imageId)
actions := []*action.Action{
&updateStatusInRiak,
&createContainer,
&startContainer,
&updateStatusInRiak,
&setNetworkInfo,
&followLogsAndCommit,
}
pipeline := action.NewPipeline(actions...)
args := runContainerActionsArgs{
box: box,
imageId: imageId,
writer: w,
isDeploy: true,
buildingImage: imageId,
containerStatus: provision.StatusLaunching,
provisioner: p,
}
err := pipeline.Execute(args)
if err != nil {
fmt.Fprintf(w, "deploy pipeline for box (%s)\n --> %s", box.GetFullName(), err)
return "", err
}
return imageId, nil
}
开发者ID:vijaykanthm28,项目名称:vertice,代码行数:30,代码来源:provisioner.go
示例3: Stop
func (p *oneProvisioner) Stop(box *provision.Box, process string, w io.Writer) error {
fmt.Fprintf(w, "\n--- stoping box (%s)\n", box.GetFullName())
args := runMachineActionsArgs{
box: box,
writer: w,
isDeploy: false,
machineStatus: provision.StatusStopping,
provisioner: p,
}
actions := []*action.Action{
&updateStatusInRiak,
&stopMachine,
&updateStatusInRiak,
}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(args)
if err != nil {
fmt.Fprintf(w, "--- stoping box (%s)\n --> %s", box.GetFullName(), err)
return err
}
return nil
}
开发者ID:vijaykanthm28,项目名称:vertice,代码行数:25,代码来源:provisioner.go
示例4: Bootstrap
func (p *chefsoloProvisioner) Bootstrap(box *provision.Box, w io.Writer) error {
fmt.Fprintf(w, "--- bootstrap box (%s)\n", box.GetFullName())
actions := []*action.Action{
&createMachine,
&updateStatusInRiak,
&updateIpsInRiak,
&appendAuthKeys,
&updateStatusInRiak,
&changeStateofMachine,
}
pipeline := action.NewPipeline(actions...)
args := runMachineActionsArgs{
box: box,
writer: w,
machineStatus: constants.StatusBootstrapping,
provisioner: p,
}
if err := pipeline.Execute(args); err != nil {
return err
}
fmt.Fprintf(w, "--- bootstrap box (%s) OK\n", box.GetFullName())
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:26,代码来源:provisioner.go
示例5: StopComponent
func StopComponent(app *global.Component) error {
actions := []*action.Action{&stopComponent}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(app)
if err != nil {
return &AppLifecycleError{app: app.Name, Err: err}
}
return nil
}
开发者ID:rajthilakmca,项目名称:megamgulp,代码行数:10,代码来源:app.go
示例6: StartApp
func StartApp(app *global.AssemblyWithComponents) error {
actions := []*action.Action{&startApp}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(app)
if err != nil {
return &AppLifecycleError{app: app.Name, Err: err}
}
return nil
}
开发者ID:rajthilakmca,项目名称:megamgulp,代码行数:10,代码来源:app.go
示例7: StreamLogs
func StreamLogs(logs *global.DockerLogsInfo) error {
actions := []*action.Action{&streamLogs}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(logs)
if err != nil {
return &AppLifecycleError{app: logs.ContainerName, Err: err}
}
return nil
}
开发者ID:rajthilakmca,项目名称:megamgulp,代码行数:10,代码来源:app.go
示例8: AnalyticsProcess
//
// this executes all actions for megam install
//
func AnalyticsProcess(app *global.App) error {
actions := []*action.Action{&analyticsAction}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(app)
if err != nil {
return err
}
return nil
}
开发者ID:fun-alex-alex2006hw,项目名称:gomegam,代码行数:13,代码来源:app.go
示例9: Shipper
func Shipper(app *global.Assemblies) error {
actions := []*action.Action{&shipper}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(app)
if err != nil {
return &AppLifecycleError{app: app.Name, Err: err}
}
return nil
}
开发者ID:rajthilakmca,项目名称:megamgulp,代码行数:10,代码来源:app.go
示例10: ConfigureNetworks
func ConfigureNetworks(networks *global.DockerNetworksInfo) error {
actions := []*action.Action{&configureNetworks}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(networks)
if err != nil {
return &AppLifecycleError{app: networks.ContainerId, Err: err}
}
return nil
}
开发者ID:rajthilakmca,项目名称:megamgulp,代码行数:11,代码来源:app.go
示例11: opsBind
func (u *Upgradeable) opsBind(writer io.Writer) error {
u.w = writer
fmt.Fprintf(u.w, " ops bind (%s) is kicking\n", u.B.GetFullName())
actions := []*action.Action{
&setEnvsAction,
}
pipeline := action.NewPipeline(actions...)
args := runOpsPipelineArgs{
box: u.B,
writer: u.w,
}
if err := pipeline.Execute(&args); err != nil {
return err
}
fmt.Fprintf(u.w, " ops bind (%s) OK\n", u.B.GetFullName())
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:18,代码来源:upgrade.go
示例12: LauncherHelper
func LauncherHelper(asm *global.AssemblyWithComponents, id string, instance bool, act_id string) error {
pair_host, perrscm := global.ParseKeyValuePair(asm.Inputs, "provider")
if perrscm != nil {
log.Error("Failed to get the host value : %s", perrscm)
}
if pair_host.Value == "docker" {
log.Debug("Docker provisioner entry")
// Provisioner
p, err := provisioner.GetProvisioner("docker")
if err != nil {
return err
}
log.Info("Provisioner: %v", p)
_, perr := p.Create(asm, id, instance, act_id)
if perr != nil {
return perr
}
}
if pair_host.Value == "chef" {
p, err := provisioner.GetProvisioner("chef")
if err != nil {
return err
}
str, perr := p.Create(asm, id, instance, act_id)
if perr != nil {
return perr
}
asm.Command = str
actions := []*action.Action{&launchedApp}
pipeline := action.NewPipeline(actions...)
aerr := pipeline.Execute(asm)
if aerr != nil {
return aerr
}
}
return nil
}
开发者ID:WH-Wang,项目名称:megamd,代码行数:43,代码来源:assembly.go
示例13: opsBuild
func (u *Upgradeable) opsBuild(writer io.Writer) error {
u.w = writer
fmt.Fprintf(u.w, " ops ci (%s) is kicking\n", u.B.GetFullName())
actions := []*action.Action{
&cloneBox,
&buildBox, //buildpack does everthing
}
pipeline := action.NewPipeline(actions...)
args := runOpsPipelineArgs{
box: u.B,
writer: u.w,
}
if err := pipeline.Execute(&args); err != nil {
return err
}
fmt.Fprintf(u.w, " ops ci (%s) OK\n", u.B.GetFullName())
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:19,代码来源:upgrade.go
示例14: createLogPipeline
func (p *DockerProvisioner) createLogPipeline(writer io.Writer, closeChan chan bool) error {
actions := []*action.Action{
&setLogs,
}
pipeline := action.NewPipeline(actions...)
args := runLogsActionsArgs{
Id: p.ContainerId,
Name: p.ContainerName,
HomeDir: p.HomeDir,
Writer: writer,
CloseChan: closeChan,
}
err := pipeline.Execute(args)
if err != nil {
log.Errorf("Error on executing Log setup")
return err
}
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:20,代码来源:provisioner.go
示例15: createNetworkPipeline
func (p *DockerProvisioner) createNetworkPipeline() error {
actions := []*action.Action{
&setNetwork,
}
pipeline := action.NewPipeline(actions...)
args := runNetworkActionsArgs{
Id: p.ContainerId,
IpAddr: p.IpAddr,
Bridge: p.Bridge,
Gateway: p.Gateway,
HomeDir: p.HomeDir,
}
err := pipeline.Execute(args)
if err != nil {
log.Errorf("Error on executing Network setup")
return err
}
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:20,代码来源:provisioner.go
示例16: SetBoxStatus
func (p *dockerProvisioner) SetBoxStatus(box *provision.Box, w io.Writer, status provision.Status) error {
fmt.Fprintf(w, "\n---- status %s box %s ----\n", box.GetFullName(), status.String())
actions := []*action.Action{
&updateStatusInRiak,
}
pipeline := action.NewPipeline(actions...)
args := runContainerActionsArgs{
box: box,
writer: w,
containerStatus: status,
provisioner: p,
}
err := pipeline.Execute(args)
if err != nil {
log.Errorf("error on execute status pipeline for box %s - %s", box.GetFullName(), err)
return err
}
return nil
}
开发者ID:vijaykanthm28,项目名称:vertice,代码行数:21,代码来源:provisioner.go
示例17: Stop
func (p *chefsoloProvisioner) Stop(b *provision.Box, w io.Writer) error {
fmt.Fprintf(w, "--- stop box (%s)\n", b.GetFullName())
actions := []*action.Action{
&updateStatusInRiak,
&stopBox,
&updateStatusInRiak,
}
pipeline := action.NewPipeline(actions...)
args := runMachineActionsArgs{
box: b,
writer: w,
machineStatus: constants.StatusStopping,
provisioner: p,
}
if err := pipeline.Execute(args); err != nil {
log.Errorf("error on execute stop pipeline for box %s - %s", b.GetFullName(), err)
return err
}
fmt.Fprintf(w, "--- stop box (%s) OK\n", b.GetFullName())
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:22,代码来源:provisioner.go
示例18: SetState
func (p *oneProvisioner) SetState(box *provision.Box, w io.Writer, changeto provision.Status) error {
fmt.Fprintf(w, "\n--- stateto %s\n", box.GetFullName())
args := runMachineActionsArgs{
box: box,
writer: w,
machineStatus: changeto,
provisioner: p,
}
actions := []*action.Action{
&changeStateofMachine,
&addNewRoute,
}
pipeline := action.NewPipeline(actions...)
err := pipeline.Execute(args)
if err != nil {
return err
}
err = doneNotify(box, w, alerts.LAUNCHED)
return err
}
开发者ID:vijaykanthm28,项目名称:vertice,代码行数:23,代码来源:provisioner.go
示例19: kickOffSolo
//1. &prepareJSON in generate the json file for chefsolo
//2. &prepareConfig in generate the config file for chefsolo.
//3. &updateStatus in Riak - Creating..
func (p *chefsoloProvisioner) kickOffSolo(b *provision.Box, w io.Writer) error {
fmt.Fprintf(w, "--- kickofff chefsolo box (%s)\n", b.GetFullName())
soloAction := make([]*action.Action, 0, 4)
soloAction = append(soloAction, &generateSoloJson, &generateSoloConfig, &cloneBox)
if b.Level != provision.BoxNone {
soloAction = append(soloAction, &chefSoloRun)
}
soloAction = append(soloAction, &updateStatusInRiak)
actions := soloAction
pipeline := action.NewPipeline(actions...)
args := runMachineActionsArgs{
box: b,
writer: w,
machineStatus: constants.StatusRunning,
provisioner: p,
}
if err := pipeline.Execute(args); err != nil {
log.Errorf("error on execute chefsolo pipeline for box %s - %s", b.GetFullName(), err)
return err
}
fmt.Fprintf(w, "--- kickofff chefsolo box (%s) OK\n", b.GetFullName())
return nil
}
开发者ID:rajthilakmca,项目名称:gulp,代码行数:27,代码来源:provisioner.go
注:本文中的github.com/megamsys/libgo/action.NewPipeline函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论