Skip to content
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

Remove the --push option from the collect command #67

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions snapshots/go/cmd/snapshots/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type collectConfig struct {
bazelCacheGRPCInsecure bool
bazelStderr bool
outPath string
push bool
noPrint bool
}

Expand Down Expand Up @@ -82,28 +81,10 @@ func runCollect(args []string) error {
log.Println("out path: ", cc.outPath)

// run the command
ctx := context.Background()
manifest, err := collect(cc)
if err != nil {
if _, err := collect(cc); err != nil {
return fmt.Errorf("failed to collect: %w", err)
}

if cc.push {
pc := getPushConfig(c)
pc.snapshot = manifest

obj, err := push(ctx, pc)
if err != nil {
return fmt.Errorf("failed to push snapshot: %w", err)
}

contentLenght, isOk := obj.GetContentLength()
if !isOk {
log.Printf("failed to get contentLenght of pushed snapshot: %s", obj.Path)
}
log.Printf("pushed snapshot of %d bytes: %s", contentLenght, obj.Path)
}

return nil
}

Expand Down