Skip to content

Commit

Permalink
feat(ci): add option to keep extension source files
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Sep 23, 2023
1 parent e28c17c commit a72df15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/project/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ var projectCI = &cobra.Command{
return err
}

for _, ext := range extensions {
if err := cleanupAdministrationFiles(cmd.Context(), ext.GetRootDir()); err != nil {
return err
if !shopCfg.Build.KeepExtensionSource {
for _, ext := range extensions {
if err := cleanupAdministrationFiles(cmd.Context(), ext.GetRootDir()); err != nil {
return err
}
}
}

Expand Down
1 change: 1 addition & 0 deletions shop/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Config struct {
type ConfigBuild struct {
DisableAssetCopy bool `yaml:"disable_asset_copy,omitempty"`
RemoveExtensionAssets bool `yaml:"remove_extension_assets,omitempty"`
KeepExtensionSource bool `yaml:"keep_extension_source,omitempty"`
CleanupPaths []string `yaml:"cleanup_paths,omitempty"`
}

Expand Down
3 changes: 3 additions & 0 deletions wiki/docs/shopware-project-yml-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ build:
remove_extension_assets: false
# skips the bin/console asset:install part
disable_asset_copy: false
# when enabled src/Resources/app/{storefront/administration} folder will be preserved and not deleted.
# If your plugin requires, you should move the files out of src/Resources which needs to be accessed by php and js
keep_extension_source: false
# delete additional paths after build
cleanup_paths:
- path
Expand Down

0 comments on commit a72df15

Please sign in to comment.