Documentation
¶
Index ¶
- func AddComponentsToConfig(fs opctx.FS, config *projectconfig.ProjectConfig, options *AddComponentOptions, ...) error
- func CheckOutputDir(env *azldev.Env, options *PrepareSourcesOptions) error
- func DiffComponentSources(env *azldev.Env, options *DiffSourcesOptions) (interface{}, error)
- func ListComponentConfigs(env *azldev.Env, options *ListComponentOptions) (results []projectconfig.ComponentConfig, err error)
- func NewBuildCmd() *cobra.Command
- func NewComponentAddCommand() *cobra.Command
- func NewComponentListCommand() *cobra.Command
- func NewComponentQueryCommand() *cobra.Command
- func NewDiffSourcesCmd() *cobra.Command
- func NewPrepareSourcesCmd() *cobra.Command
- func OnAppInit(app *azldev.App)
- func PrepareComponentSources(env *azldev.Env, options *PrepareSourcesOptions) error
- func QueryComponents(env *azldev.Env, options *QueryComponentsOptions) (results []*componentDetails, err error)
- type AddComponentOptions
- type BuildEnvPreservePolicy
- type ComponentBuildOptions
- type ComponentBuildResults
- func BuildComponent(env *azldev.Env, component components.Component, ...) (results ComponentBuildResults, err error)
- func BuildComponents(env *azldev.Env, components *components.ComponentSet, ...) ([]ComponentBuildResults, error)
- func SelectAndBuildComponents(env *azldev.Env, options *ComponentBuildOptions) ([]ComponentBuildResults, error)
- type DiffSourcesOptions
- type ListComponentOptions
- type PrepareSourcesOptions
- type QueryComponentsOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddComponentsToConfig ¶
func AddComponentsToConfig( fs opctx.FS, config *projectconfig.ProjectConfig, options *AddComponentOptions, names []string, ) error
Updates project config to include new software components.
func CheckOutputDir ¶
func CheckOutputDir(env *azldev.Env, options *PrepareSourcesOptions) error
CheckOutputDir verifies the output directory state before source preparation. If the directory exists and is non-empty, it either removes it (when Force is set) or returns an actionable error suggesting --force.
func DiffComponentSources ¶
func DiffComponentSources(env *azldev.Env, options *DiffSourcesOptions) (interface{}, error)
DiffComponentSources computes the diff between original and overlaid sources for a single component. When color is enabled and the output format is not JSON, the returned value is a pre-colorized string. Otherwise it is *dirdiff.DiffResult for structured output.
func ListComponentConfigs ¶
func ListComponentConfigs( env *azldev.Env, options *ListComponentOptions, ) (results []projectconfig.ComponentConfig, err error)
Lists components in the env, in accordance with options. Returns the found components.
func NewBuildCmd ¶
func NewComponentAddCommand ¶
Constructs a cobra.Command for "component add" CLI subcommand.
func NewComponentListCommand ¶
Constructs a cobra.Command for "component list" CLI subcommand.
func NewComponentQueryCommand ¶
Constructs a cobra.Command for "component query" CLI subcommand.
func NewDiffSourcesCmd ¶
NewDiffSourcesCmd constructs a cobra.Command for the "component diff-sources" CLI subcommand.
func NewPrepareSourcesCmd ¶
func OnAppInit ¶
Called once when the app is initialized; registers any commands or callbacks with the app.
func PrepareComponentSources ¶
func PrepareComponentSources(env *azldev.Env, options *PrepareSourcesOptions) error
func QueryComponents ¶
func QueryComponents( env *azldev.Env, options *QueryComponentsOptions, ) (results []*componentDetails, err error)
Queries env for component details, in accordance with options. Returns the found components.
Types ¶
type AddComponentOptions ¶
type AddComponentOptions struct{}
Options for adding components to the project configuration.
type BuildEnvPreservePolicy ¶
type BuildEnvPreservePolicy string
BuildEnvPreservePolicy defines policy for when to preserve auto-created build environments.
const ( // BuildEnvPreserveOnFailure indicates build environments should only be preserved for failed builds. BuildEnvPreserveOnFailure BuildEnvPreservePolicy = "on-failure" // BuildEnvPreserveAlways indicates all build environments should be preserved. BuildEnvPreserveAlways BuildEnvPreservePolicy = "always" // BuildEnvPreserveNever indicates build environments should *never* be preserved (i.e., always destroyed). BuildEnvPreserveNever BuildEnvPreservePolicy = "never" )
func (*BuildEnvPreservePolicy) Set ¶
func (f *BuildEnvPreservePolicy) Set(value string) error
Set parses the format from a string; used by command-line parser.
func (*BuildEnvPreservePolicy) ShouldPreserve ¶
func (f *BuildEnvPreservePolicy) ShouldPreserve(buildSucceeded bool) bool
ShouldPreserve is a helper to decide whether to preserve a build environment, based on the policy and the actual results of the build.
func (*BuildEnvPreservePolicy) String ¶
func (f *BuildEnvPreservePolicy) String() string
func (*BuildEnvPreservePolicy) Type ¶
func (f *BuildEnvPreservePolicy) Type() string
Type returns a descriptive string used in command-line help.
type ComponentBuildOptions ¶
type ComponentBuildOptions struct {
ComponentFilter components.ComponentFilter
ContinueOnError bool
NoCheck bool
SourcePackageOnly bool
BuildEnvPolicy BuildEnvPreservePolicy
LocalRepoPaths []string
LocalRepoWithPublishPath string
// MockConfigOpts is an optional set of key-value config options that will be passed through
// to mock as --config-opts key=value arguments.
MockConfigOpts map[string]string
}
type ComponentBuildResults ¶
type ComponentBuildResults struct {
// Names of the component that was built.
ComponentName string `json:"componentName"`
// Absolute paths to any source RPMs built by the operation.
SRPMPaths []string `json:"srpmPaths" table:"SRPM Paths"`
// Absolute paths to any RPMs built by the operation.
RPMPaths []string `json:"rpmPaths" table:"RPM Paths"`
}
ComponentBuildResults summarizes the results of building a single component.
func BuildComponent ¶
func BuildComponent( env *azldev.Env, component components.Component, workDirFactory *workdir.Factory, options *ComponentBuildOptions, ) (results ComponentBuildResults, err error)
func BuildComponents ¶
func BuildComponents( env *azldev.Env, components *components.ComponentSet, options *ComponentBuildOptions, ) ([]ComponentBuildResults, error)
func SelectAndBuildComponents ¶
func SelectAndBuildComponents(env *azldev.Env, options *ComponentBuildOptions, ) ([]ComponentBuildResults, error)
type DiffSourcesOptions ¶
type DiffSourcesOptions struct {
ComponentFilter components.ComponentFilter
OutputFile string
}
DiffSourcesOptions holds the options for the diff-sources command.
type ListComponentOptions ¶
type ListComponentOptions struct {
// Standard filter for selecting components.
ComponentFilter components.ComponentFilter
}
Options for listing components within the environment.
type PrepareSourcesOptions ¶
type PrepareSourcesOptions struct {
ComponentFilter components.ComponentFilter
OutputDir string
SkipOverlays bool
Force bool
}
type QueryComponentsOptions ¶
type QueryComponentsOptions struct {
// Standard filter for selecting components.
ComponentFilter components.ComponentFilter
}
Options for querying components from the environment.