Installation of Deployer
To use Deployer we first need to install it as dependency over composer.
To configure the deployment you need to create a deploy.php in your application.
Since version 6.4, Deployer is shipped with two recipes for Sulu. One for Sulu 1.x, based on the sulu-minimal repository, and Symfony 3 and one for Sulu 2.x, based on Symfony 4. In the following example we will use the newer Sulu 2.x recipe as the basic configuration.
Deploy the application
To deploy your application you just need to run the following command:
When you deploy for the first time, create your VHost based on the webserver you use. As Deployer uses symlinks, the webserver should be allowed to follow symlinks and the VHost should always point the the current directory of the deployed application.
Deployer has many configuration options for connections, permissions etc. and recipes which can be found in the documentation.
There are also some additional recipes in the deployer/recipes repository, e.g. one to clear opcache.
Once Deployer is configured correctly for your server, you can easily deploy your Sulu website or application using continous deployment over continous integration server.
Give it a try and let us know if the Deployer recipes for Sulu works correctly for you.