PHPackages                             bestit/shopware-mage-tasks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. bestit/shopware-mage-tasks

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

bestit/shopware-mage-tasks
==========================

Common tasks to deploy a shopware project using MagePHP

0.10.0(6y ago)614.7k[3 PRs](https://github.com/bestit/ShopwareMageTasks/pulls)MITPHP ^7.0

Since Apr 30Compare

[ Source](https://github.com/bestit/ShopwareMageTasks)[ Packagist](https://packagist.org/packages/bestit/shopware-mage-tasks)[ RSS](/packages/bestit-shopware-mage-tasks/feed)WikiDiscussions Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (52)Used By (0)

Shopware Mage Tasks
-------------------

[](#shopware-mage-tasks)

This package includes common tasks to deploy a shopware project using [MagePHP](http://magephp.com/).

.mage.yml example
-----------------

[](#mageyml-example)

```
magephp:
    php_executable: /usr/bin/php # Leave this empty if you want to use the globally installed php executable.
    custom_tasks:
        - BestIt\Mage\Tasks\Deploy\DeployTask
        - BestIt\Mage\Tasks\Deploy\Tar\PrepareSubfolderTask     # replaces the original deploy/tar/prepare task
        - BestIt\Mage\Tasks\Env\CreateEnvFileTask
        - BestIt\Mage\Tasks\Env\SetEnvParametersTask
        - BestIt\Mage\Tasks\Env\RecursiveSetEnvParametersTask
        - BestIt\Mage\Tasks\Misc\CopyTask
        - BestIt\Mage\Tasks\Misc\DenyRobotsTxtTask
        - BestIt\Mage\Tasks\Misc\SubComposerInstallTask
        - BestIt\Mage\Tasks\Opcode\BuildCleaner
        - BestIt\Mage\Tasks\Opcode\CleanReset
        - BestIt\Mage\Tasks\Release\PrepareTask
        - BestIt\Mage\Tasks\Release\SwPrepareTask
        - BestIt\Mage\Tasks\Shopware\ApplyMigrationsTask
        - BestIt\Mage\Tasks\Shopware\CommandTask
        - BestIt\Mage\Tasks\Shopware\UpdateLegacyPluginsTask
        - BestIt\Mage\Tasks\Shopware\UpdatePluginsTask
    environments:
        prod:
            user: apache
            host_path: /var/www/html
            releases: 4
            # Add php_executable in environment options to overwrite the global configuration above
            php_executable: /usr/bin/env/path/to/php
            # Add console_script_path in environment options to overwrite the default ./bin/console
            console_script_path: ./bin/console
            hosts:
                - production_server1
            pre-deploy:
                - env/create-env-file:
                    file: '.env'
                    whitelist:
                        - foo
                        - bar
                # Prefix
                - env/set-env-parameters: { file: 'configs/config_prod.php', prefix: 'ENV_', placeholderWrapper: '__' }
                # Iterates over all module sub directories, looking for parameter.xml..dist files and creates parameter.xmls from them.
                - env/recursive-set-env-parameters: { directory: 'custom/plugins/PluginName/Module', fileName: 'parameter.xml.dist', prefix: 'ENV_', encodeForXml: true, deleteTargets: true }
                - misc/deny-robots-txt: { folder: 'OPTIONAL_LOCAL_FOLDER' }
                - opcode/build-cleaner: { doc_root: 'RELATIVE_DOC_ROOT for saving the cleaner script.' }
            on-deploy:
               - composer/sub-install:
                    flags: '--no-dev'
                    globs:
                        - '/var/www/parent/*/composer.json'
                        - '/custom/*/*/composer.json'

                # Skips default prepare task which is not needed.
                - deploy/release/prepare

                # Creates new release directory and copies all content of current into the created directory.
                - prepare/sw-structure: { timeout: 500 }

                 # Creates a new symlink.
                - fs/link: { from: '../../media', to: 'media' }
                - fs/link: { from: '../../files', to: 'files' }

                # Pushes file(s) to server(s).
                # If strict is true, it will actually do a sync (i.e. delete files that do not exist locally anymore).
                # Otherwise it would just upload&overwrite without touching files that do not exist locally anymore.
                - deploy: { from: 'configs/config_prod.php', to: './config.php' }
                - deploy: { from: 'scripts/remote/', to: './scripts/', strict: true, timeout: 500 }
                - deploy: { from: 'libraries/', to: './engine/Library/', strict: false }
                - deploy: { from: 'legacy_plugins/Community/', to: 'engine/Shopware/Plugins/Community/', strict: false }
                - deploy: { from: 'legacy_plugins/Local/', to: 'engine/Shopware/Plugins/Local/', strict: true }
                - deploy: { from: 'plugins/', to: 'custom/plugins/', strict: true }
                - deploy: { from: 'licenses/', to: 'licenses/', strict: true }

                # Execute "raw" command on remote host.
                - exec: { cmd: './var/cache/clear_cache.sh', desc: 'Clear shopware cache.' }

                # Updates all (>=5.2 system) plugins on server(s).
                # Single remote command for executing updates is activated, default false.
                # Plugin refresh before update command is activated, default true.
                - shopware/update-plugins: { single_remote_command: true, plugin_refresh: true }

                # Updates all (legacy) plugins on server(s). "Sources" are the Community/Local folders.
                - shopware/update-legacy-plugins: { sync_sources_folders: true, single_remote_command: false }

                # Executes all SQL migrations on server(s). Both parameters are optional.
                - shopware/migrate: { table_suffix: 'bestit', migration_dir: 'sql' }

                # Executes remote the shopware commands

                # If ignoreReturnValue is true all return values of the command will be ignored.
                # The usage of this option should be considered carefully because with this options no differentiation
                # between an successful command call and an error command call is possible.
                # This option is necessary because specific shopware commands like plugin install will indicate an
                # if the plugin is already installed

                # Installs an activate an plugin
                - shopware/command: { cmd: 'sw:plugin:install --activate Cron', ignoreReturnValue: true }

                # Warms up the shopware theme cache on server(s).
                - shopware/command: { cmd: 'sw:theme:cache:generate' }
            post-deploy:
                - opcode/build-cleaner:
                    doc_root: 'RELATIVE_DOC_ROOT for saving the cleaner script.'
                    urls:
                        - $APPSERVER_URL_1
                        - $APPSERVER_URL_2
                        - $APPSERVER_URL_3
```

Installation
------------

[](#installation)

### Step 1: Composer

[](#step-1-composer)

Run:

```
composer require bestit/shopware-mage-tasks --dev

```

### Step 2: .mage.yml

[](#step-2-mageyml)

Create a .mage.yml file in your project root directory and define your desired tasks as per the example above. For more information about what you can do check out the [documentation](http://magephp.com/).

### Step 3: Initial folder structure on the deploy target

[](#step-3-initial-folder-structure-on-the-deploy-target)

Before the first deployment with mage, you need to set up the folder structure manually, because the original mage deploy/release/prepare-task is skipped and replaced by the prepare/sw-structure-task which performs an ordinary file copy from CURRENT to the newly created REALEASE:

```
- host_path on SERVER
    - current -> release/initial    (Symlink)
    - release
        - initial
            - bin
            - configs
            - custom
            - engine
            - files -> ../../files  (Symlink)
            - media -> ../../media  (Symlink)
            - recovery
            - scripts
            - themes
            - var
            - vendor
            - web
            ...
    - media
    - files

```

### Step 4: That's it!

[](#step-4-thats-it)

You just need to run the deployment script:

```
vendor/bin/mage deploy

```

License
-------

[](#license)

This software is open-sourced under the MIT license.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity61

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Recently: every ~291 days

Total

43

Last Release

1400d ago

Major Versions

0.10.0 → 1.0.0-RC12022-08-30

PHP version history (2 changes)0.7.0PHP ^7.0

1.0.0-RC1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/acc5af332f2a79dedb5aea83c3b4c2665d99fd2c14743fd0c2a3d70ecf0b7859?d=identicon)[best-it](/maintainers/best-it)

---

Tags

shopwaredeploymentmagephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bestit-shopware-mage-tasks/health.svg)

```
[![Health](https://phpackages.com/badges/bestit-shopware-mage-tasks/health.svg)](https://phpackages.com/packages/bestit-shopware-mage-tasks)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[timokoerber/laravel-one-time-operations

Run operations once after deployment - just like you do it with migrations!

6522.0M15](/packages/timokoerber-laravel-one-time-operations)[andres-montanez/magallanes

The Deployment Tool for PHP Applications

6881.1M6](/packages/andres-montanez-magallanes)[dg/ftp-deployment

A tool for automated deployment of web applications to an FTP server.

616850.8k8](/packages/dg-ftp-deployment)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
