-
Notifications
You must be signed in to change notification settings - Fork 190
Multiple accounts for deployment #703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |
| "os/user" | ||
| "path/filepath" | ||
| "strings" | ||
| "sync" | ||
|
|
||
| . "github.com/ForceCLI/force/error" | ||
| . "github.com/ForceCLI/force/lib" | ||
|
|
@@ -92,6 +93,14 @@ func sourceDir(cmd *cobra.Command) string { | |
| } | ||
|
|
||
| func runImport(root string, options ForceDeployOptions, displayOptions *deployOutputOptions) { | ||
| if displayOptions.quiet { | ||
| previousLogger := Log | ||
| var l quietLogger | ||
| Log = l | ||
| defer func() { | ||
| Log = previousLogger | ||
| }() | ||
| } | ||
| files := make(ForceMetadataFiles) | ||
| if _, err := os.Stat(filepath.Join(root, "package.xml")); os.IsNotExist(err) { | ||
| ErrorAndExit(" \n" + filepath.Join(root, "package.xml") + "\ndoes not exist") | ||
|
|
@@ -113,11 +122,27 @@ func runImport(root string, options ForceDeployOptions, displayOptions *deployOu | |
| ErrorAndExit(err.Error()) | ||
| } | ||
|
|
||
| err = deploy(force, files, &options, displayOptions) | ||
| if err == nil && displayOptions.reportFormat == "text" && !displayOptions.quiet { | ||
| fmt.Printf("Imported from %s\n", root) | ||
| } | ||
| if err != nil && (!errors.Is(err, testFailureError) || displayOptions.errorOnTestFailure) { | ||
| ErrorAndExit(err.Error()) | ||
| var deployments sync.WaitGroup | ||
| status := deployStatus{aborted: false} | ||
|
|
||
| for _, f := range manager.getAllForce() { | ||
| if status.isAborted() { | ||
| break | ||
| } | ||
| current := f | ||
| deployments.Add(1) | ||
| go func() { | ||
| defer deployments.Done() | ||
| err := deployWith(current, &status, files, &options, displayOptions) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we'll need to return the results so we can combine them. We'll get invalid output, especially with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we display all the messages from one goroutine then the next and so on so forth? |
||
| if err == nil && displayOptions.reportFormat == "text" && !displayOptions.quiet { | ||
| fmt.Printf("Imported from %s\n", root) | ||
| } | ||
| if err != nil && (!errors.Is(err, testFailureError) || displayOptions.errorOnTestFailure) && !status.isAborted() { | ||
| fmt.Fprintf(os.Stderr, "Aborting deploy due to %s\n", err.Error()) | ||
| status.abort() | ||
| } | ||
| }() | ||
| } | ||
|
|
||
| deployments.Wait() | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.