Example #1
0
// NewCommandSTIBuilder provides a CLI handler for STI build type
func NewCommandSTIBuilder(name string) *cobra.Command {
	cmd := &cobra.Command{
		Use:   name,
		Short: "Run a Source-to-Images build",
		Long:  stiBuilderLong,
		Run: func(c *cobra.Command, args []string) {
			go func() {
				for {
					sigs := make(chan os.Signal, 1)
					signal.Notify(sigs, syscall.SIGQUIT)
					buf := make([]byte, 1<<20)
					for {
						<-sigs
						runtime.Stack(buf, true)
						glog.Infof("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf)
					}
				}
			}()
			cmd.RunSTIBuild()
		},
	}

	cmd.AddCommand(version.NewVersionCommand(name))
	return cmd
}
Example #2
0
// NewCommandSTIBuilder provides a CLI handler for STI build type
func NewCommandSTIBuilder(name string) *cobra.Command {
	cmd := &cobra.Command{
		Use:   name,
		Short: "Run a Source-to-Images build",
		Long:  stiBuilderLong,
		Run: func(c *cobra.Command, args []string) {
			cmd.RunSTIBuild()
		},
	}

	cmd.AddCommand(version.NewVersionCommand(name))
	return cmd
}
Example #3
0
// NewCommandSTIBuilder provides a CLI handler for STI build type
func NewCommandSTIBuilder(name string) *cobra.Command {
	cmd := &cobra.Command{
		Use:   name,
		Short: "Run a Source-to-Image build",
		Long:  stiBuilderLong,
		Run: func(c *cobra.Command, args []string) {
			err := cmd.RunSTIBuild(c.Out())
			kcmdutil.CheckErr(err)
		},
	}

	cmd.AddCommand(version.NewVersionCommand(name, false))
	return cmd
}
Example #4
0
// NewCommandSTIBuilder provides a CLI handler for STI build type
func NewCommandSTIBuilder(name string) *cobra.Command {
	cmd := &cobra.Command{
		Use:   name,
		Short: "Run a Source-to-Image build",
		Long:  stiBuilderLong,
		Run: func(c *cobra.Command, args []string) {
			err := cmd.RunSTIBuild(c.Out())
			kcmdutil.CheckErr(err)
		},
	}

	cmd.AddCommand(ocmd.NewCmdVersion(name, nil, os.Stdout, ocmd.VersionOptions{}))
	return cmd
}