當前位置: 首頁>>代碼示例>>Golang>>正文


Golang action.NewPipeline函數代碼示例

本文整理匯總了Golang中github.com/megamsys/libgo/action.NewPipeline函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewPipeline函數的具體用法?Golang NewPipeline怎麽用?Golang NewPipeline使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewPipeline函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的github.com/megamsys/libgo/action.NewPipeline函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。