Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / CI run build and linting (pull_request) Successful in 20m7s
CI Workflow / Code coverage report (pull_request) Successful in 5s
CI Workflow / CI run tests (pull_request) Failing after 21m28s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 29m1s
42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package cmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/generator/cmd/build"
|
|
)
|
|
|
|
var (
|
|
skipCleanup bool
|
|
skipClone bool
|
|
packagesOnly bool
|
|
verbose bool
|
|
debug bool
|
|
)
|
|
|
|
var buildCmd = &cobra.Command{
|
|
Use: "build",
|
|
Short: "Build the necessary boilerplate",
|
|
Long: `...`,
|
|
RunE: func(_ *cobra.Command, _ []string) error {
|
|
b := build.Builder{
|
|
SkipClone: skipClone,
|
|
SkipCleanup: skipCleanup,
|
|
PackagesOnly: packagesOnly,
|
|
Verbose: verbose,
|
|
Debug: debug,
|
|
}
|
|
return b.Build()
|
|
},
|
|
}
|
|
|
|
func NewBuildCmd() *cobra.Command {
|
|
return buildCmd
|
|
}
|
|
|
|
func init() { //nolint:gochecknoinits // This is the standard way to set up Cobra commands
|
|
buildCmd.Flags().BoolVarP(&skipCleanup, "skip-clean", "c", false, "Skip cleanup steps")
|
|
buildCmd.Flags().BoolVarP(&debug, "debug", "d", false, "Enable debug output")
|
|
buildCmd.Flags().BoolVarP(&skipClone, "skip-clone", "g", false, "Skip cloning from git")
|
|
buildCmd.Flags().BoolVarP(&packagesOnly, "packages-only", "p", false, "Only generate packages")
|
|
buildCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "verbose - show more logs")
|
|
}
|