Skip to content

Commit

Permalink
option to print the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed Jan 24, 2025
1 parent 71d5a82 commit 121d63d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildkit/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewBuildGraph(plan *plan.BuildPlan, baseState *llb.State, cacheStore *Build
}

graph.computeTransitiveDependencies()
graph.PrintGraph()
// graph.PrintGraph()

return graph, nil
}
Expand Down
8 changes: 7 additions & 1 deletion cli/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"github.com/urfave/cli/v3"
)

const (
PRINT_GRAPH = false
)

var BuildCommand = &cli.Command{
Name: "build",
Aliases: []string{"b"},
Expand Down Expand Up @@ -53,7 +57,9 @@ var BuildCommand = &cli.Command{
return cli.Exit(err, 1)
}

log.Debug(string(serializedPlan))
if PRINT_GRAPH {
log.Debug(string(serializedPlan))
}

err = buildkit.BuildWithBuildkitClient(app.Source, buildResult.Plan, buildkit.BuildWithBuildkitClientOptions{
ImageName: cmd.String("name"),
Expand Down

0 comments on commit 121d63d

Please sign in to comment.