cmd

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	RulesetPath            = "/opt/rulesets"
	OpenRewriteRecipesPath = "/opt/openrewrite"
	InputPath              = "/opt/input"
	OutputPath             = "/opt/output"
	XMLRulePath            = "/opt/xmlrules"
	ShimOutputPath         = "/opt/shimoutput"
	CustomRulePath         = "/opt/input/rules"
	JavaBundlesLocation    = "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar"
)

Variables

View Source
var (
	// TODO (pgaikwad): this assumes that the $USER in container is always root, it may not be the case in future
	M2Dir = path.Join("/", "root", ".m2")
	// application source path inside the container
	SourceMountPath = path.Join(InputPath, "source")
	// analyzer config files
	ConfigMountPath = path.Join(InputPath, "config")
	// user provided rules path
	RulesMountPath = path.Join(RulesetPath, "input")
	// paths to files in the container
	AnalysisOutputMountPath   = path.Join(OutputPath, "output.yaml")
	DepsOutputMountPath       = path.Join(OutputPath, "dependencies.yaml")
	ProviderSettingsMountPath = path.Join(ConfigMountPath, "settings.json")
)
View Source
var (
	BuildCommit = ""
	Version     = "v99.0.0"
)
View Source
var Settings = &Config{}

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewAnalyzeCmd

func NewAnalyzeCmd(log logr.Logger) *cobra.Command

analyzeCmd represents the analyze command

func NewContainer

func NewContainer(log logr.Logger) *container

func NewOpenRewriteCommand

func NewOpenRewriteCommand(log logr.Logger) *cobra.Command

func NewTransformCommand

func NewTransformCommand(log logr.Logger) *cobra.Command

func NewVersionCommand added in v0.3.1

func NewVersionCommand() *cobra.Command

Use build flags to set correct Version and BuildCommit e.g.: --ldflags="-X 'github.com/konveyor-ecosystem/kantra/cmd.Version=1.2.3' -X 'github.com/konveyor-ecosystem/kantra/cmd.BuildCommit=$(git rev-parse HEAD)'"

func NewWindupShimCommand

func NewWindupShimCommand(log logr.Logger) *cobra.Command

Types

type Config

type Config struct {
	RootCommandName string `env:"CMD_NAME" default:"kantra"`
	PodmanBinary    string `env:"PODMAN_BIN" default:"/usr/bin/podman"`
	RunnerImage     string `env:"RUNNER_IMG" default:"quay.io/konveyor/kantra"`
	JvmMaxMem       string `env:"JVM_MAX_MEM" default:""`
}

func (*Config) Load

func (c *Config) Load() error

type Option

type Option func(c *container)

func WithCleanup

func WithCleanup(cl bool) Option

func WithEntrypointArgs

func WithEntrypointArgs(args ...string) Option

func WithEntrypointBin

func WithEntrypointBin(b string) Option

func WithEnv

func WithEnv(k string, v string) Option

func WithImage

func WithImage(i string) Option

func WithName

func WithName(n string) Option

func WithStderr

func WithStderr(e ...io.Writer) Option

func WithStdout

func WithStdout(o ...io.Writer) Option

func WithVolumes

func WithVolumes(m map[string]string) Option

func WithWorkDir

func WithWorkDir(w string) Option

func WithcFlag

func WithcFlag(cl bool) Option

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL