pulumi/pkg/engine/destroy.go
joeduffy 22387d24cd Switch to a --parallel=P flag
This change flips the polarity on parallelism: rather than having a
--serialize flag, we will have a --parallel=P flag, and by default
we will shut off parallelism.  We aren't benefiting from it at the
moment (until we implement pulumi/pulumi-fabric#106), and there are
more hidden dependencies in places like AWS Lambdas and Permissions
than I had realized.  We may revisit the default, but this allows
us to bite off the messiness of dependsOn only when we benefit from
it.  And in any case, the --parallel=P capability will be useful.
2017-09-17 08:10:46 -07:00

30 lines
615 B
Go

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import "github.com/pulumi/pulumi-fabric/pkg/tokens"
type DestroyOptions struct {
Environment string
Package string
DryRun bool
Debug bool
Parallel int
Summary bool
}
func (eng *Engine) Destroy(opts DestroyOptions) error {
info, err := eng.initEnvCmdName(tokens.QName(opts.Environment), opts.Package)
if err != nil {
return err
}
return eng.deployLatest(info, deployOptions{
Debug: opts.Debug,
Destroy: true,
DryRun: opts.DryRun,
Parallel: opts.Parallel,
Summary: opts.Summary,
})
}