本文整理匯總了Golang中github.com/tsuru/tsuru/action.Pipeline.Result方法的典型用法代碼示例。如果您正苦於以下問題:Golang Pipeline.Result方法的具體用法?Golang Pipeline.Result怎麽用?Golang Pipeline.Result使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/tsuru/tsuru/action.Pipeline
的用法示例。
在下文中一共展示了Pipeline.Result方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: runReplaceUnitsPipeline
func (p *dockerProvisioner) runReplaceUnitsPipeline(w io.Writer, a provision.App, toAdd map[string]*containersToAdd, toRemoveContainers []container.Container, imageId string, toHosts ...string) ([]container.Container, error) {
var toHost string
if len(toHosts) > 0 {
toHost = toHosts[0]
}
if w == nil {
w = ioutil.Discard
}
args := changeUnitsPipelineArgs{
app: a,
toAdd: toAdd,
toRemove: toRemoveContainers,
toHost: toHost,
writer: w,
imageId: imageId,
provisioner: p,
}
var pipeline *action.Pipeline
if p.isDryMode {
pipeline = action.NewPipeline(
&provisionAddUnitsToHost,
&provisionRemoveOldUnits,
)
} else {
pipeline = action.NewPipeline(
&provisionAddUnitsToHost,
&bindAndHealthcheck,
&addNewRoutes,
&removeOldRoutes,
&updateAppImage,
&provisionRemoveOldUnits,
&provisionUnbindOldUnits,
)
}
err := pipeline.Execute(args)
if err != nil {
return nil, err
}
return pipeline.Result().([]container.Container), nil
}