Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildCmd = &cobra.Command{ Use: "build", Short: "Builds the agent and controller binaries", Long: "Builds the agent and controller binaries", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { userHomeDir, err := os.UserHomeDir() if err != nil { return err } builderCacheRoot = filepath.Join(userHomeDir, ".aperturectl", "build") err = os.MkdirAll(builderCacheRoot, os.ModePerm) if err != nil { return err } if apertureURI != "" && apertureVersion != defaultApertureVersion { return errors.New("either the URI or version should be set, not both") } if apertureURI == "" { if apertureVersion == defaultApertureVersion { apertureVersion, err = utils.ResolveLatestVersion() if err != nil { return err } } apertureURI = fmt.Sprintf("%s@%s", defaultApertureRepo, apertureVersion) } else { apertureURI, err = filepath.Abs(apertureURI) if err != nil { return err } } dirName := strings.ReplaceAll(apertureURI, "/", "_") builderURIRoot = filepath.Join(builderCacheRoot, dirName) err = os.MkdirAll(builderURIRoot, os.ModePerm) if err != nil { return err } if !skipPull && cmd.Use != "remove" { err = utils.PullSource(builderURIRoot, apertureURI) if err != nil { return err } } else { log.Debug().Msg("skipping pulling aperture repository") } builderDir = filepath.Join(builderURIRoot, utils.GetRelPath(builderURIRoot)) builderDir, err = filepath.EvalSymlinks(builderDir) if err != nil { return err } return nil }, }
BuildCmd is the root command for the build command.
Functions ¶
This section is empty.
Types ¶
type BuildConfig ¶
type BuildConfig struct { Version string `json:"version" default:"unknown"` GitCommitHash string `json:"git_commit_hash"` GitBranch string `json:"git_branch"` LdFlags []string `json:"ldflags"` Flags []string `json:"flags"` }
BuildConfig picked up from environment variables.
type Config ¶
type Config struct { Build BuildConfig `json:"build"` BundledExtensions []string `json:"bundled_extensions"` Extensions []ExtensionConfig `json:"extensions"` Replaces []ReplaceConfig `json:"replaces"` EnableCoreExtensions bool `json:"enable_core_extensions" default:"true"` }
Config is the configuration for building the binary.
type ExtensionConfig ¶
type ExtensionConfig struct { // GoModName. e.g. github.com/fluxninja/aperture-extensions/extension/test GoModName string `json:"go_mod_name" validate:"required"` // Version e.g. v0.0.1 Version string `json:"version" validate:"required"` // PkgName name of the extension. e.g. test PkgName string `json:"pkg_name"` }
ExtensionConfig is the configuration for an extension.
type ReplaceConfig ¶
type ReplaceConfig struct { Old string `json:"old" validate:"required"` New string `json:"new" validate:"required"` }
ReplaceConfig is the configuration for a replace directive.
Click to show internal directories.
Click to hide internal directories.