This package provides a simple way to manage your Shopware plugins. It can handle the installation, update and removal of plugins.
The package provides a new command netzarbeiter:plugin:manage
which can be used to manage your plugins. The command
takes a JSON file with plugins that should be active in your Shopware installation.
bin/console netzarbeiter:plugin:manage <file>
Do not install or uninstall plugins, just show what would be done.
The command takes a JSON file with the following schema:
{
"<plugin name>": {
"active": true|false,
"update": true|false|"force"
}
}
The command will install all plugins in that file, activate them if active
is true
and update them if update
is
true
and an update is available or if update
is set to "force"
(useful for local plugins).
The command will afterwards uninstall all plugins that are installed in your Shopware installation, but are not in the
plugins.json
file.
You can use the command in your CI/CD pipeline to automate the installation of plugins. To do so, you can add the
command as a post-update script to your composer.json
file:
{
"scripts": {
"post-install-cmd": [
"[ ! -f vendor/autoload.php ] || [ ! -f plugins.json ] || ($PHP_BINARY bin/console plugin:refresh -s && $PHP_BINARY bin/console netzarbeiter:plugins:handle plugins.json)"
],
"post-update-cmd": [
"[ ! -f vendor/autoload.php ] || [ ! -f plugins.json ] || ($PHP_BINARY bin/console plugin:refresh -s && $PHP_BINARY bin/console netzarbeiter:plugins:handle plugins.json)"
]
}
}
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
$ composer require <package-name>
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require <package-name>
Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php
file of your project:
// config/bundles.php
return [
// ...
Netzarbeiter\Shopware\PluginManagement\NetzarbeiterShopwarePluginManagementBundle::class => ['all' => true],
];