Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Release Symfony2 project to the web

I have almost finished the development of a project developed with Symfony2, and wish to put the project online.

However, I suppose there are a lot of things that need to be done so that everything works ok. I suppose, the dev mode needs to be disabled etc....What needs to be done and how?

What are the most important things to do on a Symfony2 project that will be available to everyone on the web?

like image 565
Mick Avatar asked Dec 16 '22 20:12

Mick


2 Answers

I suggest you to use Capifony for deployment. It does a lot of stuff out of the box and you can make it run any custom commands you need. See its documentation for details.

Regarding the dev mode, unless you've removed the IP checks from app_dev.php, you don't have to worry about deploying it. Of course, if you wish, you can tell Capifony to delete it on deployment.

like image 59
Elnur Abdurrakhimov Avatar answered Feb 15 '23 16:02

Elnur Abdurrakhimov


The best way to handle deployment is to create "build" script, which will:

  1. Remove all folders and files with tests from your bundles and vendors.
  2. Remove app_dev.php file
  3. Make sure that app/cache and app/logs are fully writable/readable.
  4. Packs your project into archive (rpm f.e.)

Then, before deployment, you should create tag in your project - so it will mean, that certain version of your application is released (I recommend to follow this git branching model).

  1. Create tag.
  2. Run your build script
  3. Upload archive to host
  4. Unpack
  5. Enjoy your project
like image 22
Vitalii Zurian Avatar answered Feb 15 '23 15:02

Vitalii Zurian