Documentation
¶
Overview ¶
Package projectbuild provides the production build pipeline shared by project CI and deployment packaging. It does not resolve CLI flags or choose where the build runs.
Index ¶
- func Build(ctx context.Context, root string, shopCfg *shop.Config, ...) error
- func ContainerBuildCommand(root string, opts ContainerOptions) string
- func GenerateContainerFiles(ctx context.Context, root string, cfg *shop.Config, opts ContainerOptions) ([]string, error)
- func PackageArchive(ctx context.Context, root string, cfg *shop.Config, ...) (string, error)
- func RunCommand(p *executor.Process) error
- type ArchiveOptions
- type ContainerOptions
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(ctx context.Context, root string, shopCfg *shop.Config, envCfg *shop.EnvironmentConfig, opts Options) error
Build runs the production build pipeline in root using a local executor. It modifies root in place, including removing source files and creating build stubs. Callers must either provide a disposable directory or enforce their own safety policy before calling Build. Config must be loaded via shop.ReadConfig.
func ContainerBuildCommand ¶
func ContainerBuildCommand(root string, opts ContainerOptions) string
ContainerBuildCommand formats a POSIX-shell command; it never executes it. Quote all user-supplied arguments so paths and tags cannot become shell syntax.
func GenerateContainerFiles ¶
func GenerateContainerFiles(ctx context.Context, root string, cfg *shop.Config, opts ContainerOptions) ([]string, error)
GenerateContainerFiles writes standalone, committable build files into root. It does not stage the project, resolve credentials, or invoke Docker.
func PackageArchive ¶
func PackageArchive(ctx context.Context, root string, cfg *shop.Config, env *shop.EnvironmentConfig, opts ArchiveOptions) (string, error)
PackageArchive builds a private, temporary copy and publishes a tar.gz. Existing output files are never overwritten. This does not deploy anything. Hooks are trusted project code, not sandboxed processes.
func RunCommand ¶
RunCommand runs a build or asset watcher process with the fixed, non-production secret and lock defaults needed without a shop. Streams the caller has not configured inherit the terminal, so a Cobra-provided stdin or a captured stdout stay in effect. Environment variables already supplied by the executor are preserved.
Types ¶
type ArchiveOptions ¶
type ArchiveOptions struct {
// OutputPath is relative to the caller's working directory. An empty path
// creates a uniquely named artifact in root/.shopware-cli/deployments.
OutputPath string
// ConfigPath identifies a custom project config to omit from the archive.
// The resolved deployment configuration is written separately.
ConfigPath string
Build Options
}
type ContainerOptions ¶
type Options ¶
type Options struct {
WithDevDependencies bool
ToolVersion string
// Copy Composer path repositories instead of symlinking their sources.
// Reject dependencies which still create escaping links (e.g. an explicit
// Composer symlink:true option), before build cleanup can affect sources.
MirrorPathRepositories bool
}
Options contains build inputs that are not part of the project configuration.