Skip to content

Commit

Permalink
is now
Browse files Browse the repository at this point in the history
Signed-off-by: Rashad Sirajudeen <[email protected]>
  • Loading branch information
rashadism committed Jun 14, 2024
1 parent c00a832 commit f15ecf5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewPackCommand(logger ConfigurableLogger) (*cobra.Command, error) {

commands.AddHelpFlag(rootCmd, "pack")

rootCmd.AddCommand(commands.Detect(logger, cfg, packClient))
rootCmd.AddCommand(commands.ExecuteCommand(logger, cfg, packClient))
rootCmd.AddCommand(commands.Build(logger, cfg, packClient))
rootCmd.AddCommand(commands.NewBuilderCommand(logger, cfg, packClient))
rootCmd.AddCommand(commands.NewBuildpackCommand(logger, cfg, packClient, buildpackage.NewConfigReader()))
Expand Down
20 changes: 20 additions & 0 deletions internal/commands/execute.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package commands

import (
"github.com/spf13/cobra"

"github.com/buildpacks/pack/internal/config"
"github.com/buildpacks/pack/pkg/logging"
)

func ExecuteCommand(logger logging.Logger, cfg config.Config, client PackClient) *cobra.Command {
cmd := &cobra.Command{
Use: "execute",
Short: "Executes a specific phase in the buildpacks lifecycle",
RunE: nil,
}

cmd.AddCommand(ExecuteDetect(logger, cfg, client))
AddHelpFlag(cmd, "execute")
return cmd
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import (
)

// Run up to the detect phase of the CNB lifecycle against a source code directory
func Detect(logger logging.Logger, cfg config.Config, packClient PackClient) *cobra.Command {
func ExecuteDetect(logger logging.Logger, cfg config.Config, packClient PackClient) *cobra.Command {
var flags BuildFlags
flags.DetectOnly = true

cmd := &cobra.Command{
Use: "detect",
Args: cobra.ExactArgs(1),
Short: "Pack Detect runs the analyze and detect phases of the Cloud Native Buildpacks lifecycle to determine a group of applicable buildpacks and a build plan.",
Example: "pack detect --path apps/test-app --builder cnbs/sample-builder:bionic",
Long: "Pack Detect uses Cloud Native Buildpacks to run the detect phase of buildpack groups against the source code.\n",
Short: "Execute detect runs the analyze and detect phases of the Cloud Native Buildpacks lifecycle to determine a group of applicable buildpacks and a build plan.",
Example: "pack execute detect --path apps/test-app --builder cnbs/sample-builder:bionic",
Long: "Execute detect uses Cloud Native Buildpacks to run the detect phase of buildpack groups against the source code.\n",
RunE: logError(logger, func(cmd *cobra.Command, args []string) error {
inputImageName := client.ParseInputImageReference(args[0])
if err := validateBuildFlags(&flags, cfg, inputImageName, logger); err != nil {
Expand Down

0 comments on commit f15ecf5

Please sign in to comment.