This post require to know how write and read the .yaml syntaxe only : easy ! ;) What we need ? A terminal with php on your local machine A git repository for your project What we use ? automate ! This is the official website of automate : https://automate-deployer.com/ Automate It’s time to start ! First, the file .automate.yml First, add the file at the root of your project (not the public directory), write this lines : .automate.yml repository: :romaricp/kit-starter-symfony-4-docker.gitplatforms:development:default_branch: mastermax_releases: 2servers:dddv-server:host: 10.128.12.12user: devpassword: %dev_password%path: /home/wwwroot/sf4preprod:default_branch: preprodmax_releases: 2servers:pddv-server:host: 10.128.12.13user: devpassword: %preprod_password%path: /home/wwwroot/sf4shared_files:- .envshared_folders:- public/uploadon_deploy:- "composer install"- "setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX var"- "setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX var"- "php bin/console c:c --env=prod --no-debug"post_deploy:- "php bin/console doctrine:schema:update --force"- "php bin/console cache:war --no-debug" git@github.com Okay so what we have write here ? It’s just setting, not coding ;) repository: :romaricp/kit-starter-symfony-4-docker.git git@github.com Here, we just wrote the address of your project, for example here a sample project with Symfony4. platforms:development:default_branch: mastermax_releases: 2servers:dddv-server:host: 10.128.12.12user: devpassword: %dev_password%path: /home/wwwroot/sf4preprod:default_branch: preprodmax_releases: 2servers:pddv-server:host: 10.128.12.13user: devpassword: %preprod_password%path: /home/wwwroot/sf4 Here, we defined all servers we want to deploy our project. So as you can see, 2 servers are defined : and one. development preproduction For each server we defined which git branch is used via ; so for the server I want to use the branch and for the server I want to use the branch. default_branch development master preprod preprod We have to defined how many maximum releases we want to stock on each server. 2 seems good because if you get some bug after a new deployment you can rollback with one command, we will see later. servers:pddv-server:host: 10.128.12.13user: devpassword: %preprod_password%path: /home/wwwroot/sf4 Here, we defined all servers by platform, In this case we have just one server / platform but you can easely add 2 or 3 servers to deploy your project. For each server you have to define : Host User (with ssh access) The path of you project on the remote server For the password, it’s not a good practice to write this one here in this file, so that’s why we are using each side, because when you will start the deployment the terminal will ask you to enter the right password. % shared_files:- .env Here, we defined all files shared for all releases, in this case this file is for Symfony which contains all the necessary environment variables. So no matter which release is current there is just one config file for all my releases ! environment shared_folders:- public/upload Here, same story with folders. We defined all folders that we need for all releases. The best example is the upload directory. on_deploy:- "composer install"- "php bin/console c:c --env=prod --no-debug"post_deploy:- "php bin/console doctrine:schema:update --force"- "php bin/console cache:war --no-debug" Here, it’s the list of commands lines that your project need to be deploy perfectly. There are 3 events availables with automate : , and all are well explain here : pre_deploy on_deploy post_deploy https://automate-deployer.com/ doc So now your .automate.yml file is ready ! Second, install the automate.phar Go to your root path of project cd /your/path/project You can download the latest version of Automate with the following command: curl -LSs https:// Now you should get something like that : Sample with Symfony4 project It’s time to deploy ! Go to your root path of project and launch automate ! cd /your/path/project start the deployment Enter the and enjoy the show ! ;) dev_password You should get something like that : End point of the deployment What happen to our server ? Well if you go to our server, we should get something like that : our development server remote current directory is a symbolic link to the lastest release releases directory contain all last releases (depend the max_releases number you set in the .automate.yml file) shared directory contain all folders shared between every releases If we go to the you can see : shared directory the shared directory Which contain the “real” folders and files. On the other hand if we go to the current directory you can see : The file is a symbolic link to the real file which is in the shared directory. .env .env So as you can see, we deployed without a single line of code ! Automate is very easy to use and to set. Automate has a lot of plugins by default, you can see all of this to the official documentation : https://automate-deployer.com/ doc To conclude, we can now imagine to use automate and gitlab with an automatic deployment on each merge request ! ;) Thanks to & for rereading. :) Solène Louvrier Nicolas Legendre