mediameets/psh-commands

This package provides some useful PSH commands for developing and releasing plugins for Shopware 6.

dev-develop 2023-03-20 14:36 UTC

This package is auto-updated.

Last update: 2024-05-20 17:13:14 UTC


README

This package provides a library of useful generic PSH Commands when developing plugins for Shopware 5 and plugins or apps for Shopware 6.

Installation

Use composer to require this package as a development dependency in your Shopware plugin/app:

composer require mediameets/psh-commands --dev

Note from the original PSH package: Although you can use PSH as a composer dependency, we recommend to use the PHAR archive instead. As a result this command library does not install PSH as a composer dependency (any longer)!

Use library with existing psh config

Add all environments and placeholders from the .psh.xml.dist file to your psh config file.

Use library without existing psh config

Copy the .psh.xml.dist file into your plugin/app root folder:

cp vendor/mediameets/psh-commands/.psh.xml.dist .psh.xml.dist

Usually no further configuration is necessary. See configuration for more details.

Configuration for a Shopware 6 plugin or app

Name Description Default
SW6_PLUGIN_NAME The technical name of your Shopware plugin/app. basename $PWD
SW6_IS_APP Holds information if package is a Shopware app (true) or plugin (false). php -f vendor/mediameets/psh-commands/sw6/scripts/check-is-app.php
SW6_PLUGIN_VERSION Version of the Shopware 6 plugin/app. php -f vendor/mediameets/psh-commands/sw6/scripts/get-plugin-version.php
SW6_ADMINISTRATION_ASSET_FOLDER Folder of the administration assets of a Shopware 6 plugin. php -f vendor/mediameets/psh-commands/sw6/scripts/get-administration-asset-path.php
SW6_STOREFRONT_ASSET_FOLDER Folder of the storefront assets of a Shopware 6 plugin/app. php -f vendor/mediameets/psh-commands/sw6/scripts/get-storefront-asset-path.php

Configuration for a Shopware 5 plugin

Name Description Default
SW5_PLUGIN_VERSION Version of the Shopware 5 plugin. php -f vendor/mediameets/psh-commands/sw5/scripts/get-plugin-version.php

Usage

Now you can use the commands via global installed psh:

psh

Overriding

It is possible to override all of the commands in this library. One situation where you want to override the command is for example sw6:release:zip. This command creates a ZIP archive of your plugin/app folder and excludes unwanted files like composer.lock. So if you want to modify the excluded file list you need to override this command.

Do the following steps:

  1. To override the command create a folder for example psh/sw6/release/actions in your plugins/apps root folder.

  2. Then copy the sw6:release:zip action (shell script) and make the desired changes:

    cp vendor/mediameets/psh-commands/sw6/release/actions/zip.sh psh/sw6/release/actions/zip.sh
  3. Last but not least add the new path to your created folder to the .psh.xml.dist configuration file in the overriden environment:

    <environment name="sw6:release">
        <path>vendor/mediameets/psh-commands/sw6/release/actions</path>
        <path>psh/sw6/release/actions</path>
    </environment>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.