diff --git a/cli/deploy.go b/cli/deploy.go index 9759274b..1b5a478e 100644 --- a/cli/deploy.go +++ b/cli/deploy.go @@ -58,6 +58,8 @@ type DeployArgs struct { NoGit bool `arg:"--no-git" help:"don't look at git commit id for safe deploys"` Force bool `arg:"--force" help:"force a new deploy, even if the safety chain would break"` + NoAutoEdges bool `arg:"--no-autoedges" help:"skip the autoedges stage"` + DeployEmpty *cliUtil.EmptyArgs `arg:"subcommand:empty" help:"deploy empty payload"` DeployLang *cliUtil.LangArgs `arg:"subcommand:lang" help:"deploy lang (mcl) payload"` DeployYaml *cliUtil.YamlArgs `arg:"subcommand:yaml" help:"deploy yaml graph payload"` @@ -251,6 +253,8 @@ func (obj *DeployArgs) Run(ctx context.Context, data *cliUtil.Data) (bool, error deploy.Noop = obj.Noop deploy.Sema = obj.Sema + deploy.NoAutoEdges = obj.NoAutoEdges + str, err := deploy.ToB64() if err != nil { return false, errwrap.Wrapf(err, "encoding error") diff --git a/cli/run.go b/cli/run.go index 61185a24..32321385 100644 --- a/cli/run.go +++ b/cli/run.go @@ -141,6 +141,8 @@ func (obj *RunArgs) Run(ctx context.Context, data *cliUtil.Data) (bool, error) { Noop: obj.Noop, Sema: obj.Sema, //Update: obj.Update, + + NoAutoEdges: obj.NoAutoEdges, }, Fs: standaloneFs, diff --git a/gapi/deploy.go b/gapi/deploy.go index 7362853d..d053a14c 100644 --- a/gapi/deploy.go +++ b/gapi/deploy.go @@ -51,6 +51,9 @@ type Deploy struct { //Sync bool // wait for everyone to close previous GAPI before switching Noop bool Sema int // sema override + + NoAutoEdges bool + GAPI GAPI } diff --git a/gapi/gapi.go b/gapi/gapi.go index 98075e87..d6f30e0f 100644 --- a/gapi/gapi.go +++ b/gapi/gapi.go @@ -71,6 +71,8 @@ type Flags struct { Noop bool Sema int + + NoAutoEdges bool } // Info is the set of input values passed into the Cli method so that the GAPI diff --git a/lang/gapi/gapi.go b/lang/gapi/gapi.go index 562d4d68..c7e3300e 100644 --- a/lang/gapi/gapi.go +++ b/lang/gapi/gapi.go @@ -488,6 +488,9 @@ func (obj *GAPI) Cli(info *gapi.Info) (*gapi.Deploy, error) { Name: Name, Noop: info.Flags.Noop, Sema: info.Flags.Sema, + + NoAutoEdges: info.Flags.NoAutoEdges, + GAPI: &GAPI{ InputURI: fs.URI(), Data: &lang.Data{ diff --git a/lib/main.go b/lib/main.go index f8d411e5..200453d1 100644 --- a/lib/main.go +++ b/lib/main.go @@ -116,6 +116,9 @@ type Config struct { // TODO: We should consider deprecating this feature. NoDeployWatch bool `arg:"--no-deploy-watch" help:"do not change deploys after an initial deploy"` + // NoAutoEdges tells the engine to not try and build autoedges. + NoAutoEdges bool `arg:"--no-autoedges" help:"skip the autoedges stage"` + // Noop globally forces all resources into no-op mode. Noop bool `arg:"--noop" help:"globally force all resources into no-op mode"` @@ -834,13 +837,17 @@ func (obj *Main) Run() error { // XXX: can we change this into a ge.Apply operation? // add autoedges; modifies the graph only if no error - timing = time.Now() - if err := obj.ge.AutoEdge(); err != nil { - obj.ge.Abort() // delete graph - Logf("error running auto edges: %+v", err) - continue + if mainDeploy.NoAutoEdges { + Logf("skipping auto edges...") + } else { + timing = time.Now() + if err := obj.ge.AutoEdge(); err != nil { + obj.ge.Abort() // delete graph + Logf("error running auto edges: %+v", err) + continue + } + Logf("auto edges took: %s", time.Since(timing)) } - Logf("auto edges took: %s", time.Since(timing)) // XXX: can we change this into a ge.Apply operation? // run autogroup; modifies the graph