4
4
How to deploy a Symfony2 application
5
5
====================================
6
6
7
- There are several ways you can deploy a Symfony2 application:
8
-
9
- * One way is moving the files manually or via ftp if you don't use versioning
10
- (e.g. git);
11
-
12
- * If you use versioning you could still move things manually cloning or fetching
13
- your repository from the final server folder location. However it is advised
14
- you make use of better tools especially in the case where you have access
15
- capabilities such as enough permissions in a virtual private server or similar system;
16
-
17
- * Some projects are really large so they make use of more established tools for
18
- deploying not only the files but really deploy a OS or package distribution
19
- containing the sf2 project inside;
20
-
21
- * Another important thing to keep in mind is the handling of dependencies.
22
- One can use composer to fetch dependencies or include them all together with the
23
- repository. Some tools would handle this for you and even perhaps avoid fetching
24
- dependencies when a simple copy would do;
7
+ There are several ways you can deploy a Symfony2 application.
8
+
9
+ Let's start with a few basic examples of where developers typically begin with their
10
+ deployment strategies, and build on things from there.
11
+
12
+ * The most basic way of deploying an application is copying the files manually via ftp
13
+ (or similar method). This is one of the worst methods because of the complete lack of
14
+ control you have over the system as the upgrade progresses.
15
+
16
+ * When using a source code versioning tool (such as git or subversion), you can
17
+ simplify this by instead having your live installation also be a copy of your repository,
18
+ so when you're ready to upgrade it is as simple as fetching the latest updates from
19
+ your source control system. This way still causes problems when you have to incorporate
20
+ database migrations, however. It does improve upon the prior method, however, as only
21
+ the files that were changed would need to be updated, and that means your application
22
+ will be in an unstable state for far less time.
23
+
24
+ * There are tools to help ease the pains of deployment, and their use is becoming more widespread.
25
+ Now we even have a few tools which have been specifically tailored to the requirements of
26
+ Symfony2, that take special care to ensure that everything before, during, and after a deployment
27
+ has gone correctly, and is able to halt (and roll back, if necessary) the process should an error
28
+ occur.
29
+
30
+ Deployment of an application require care. The use of staging, testing, QA,
31
+ continuous integration, database migrations and capability to roll back in case of failure
32
+ are all strongly advised. There are simple and more complex tools and one can make
33
+ the deployment as easy (or sophisticated) as your environment requires.
25
34
26
- * Do remember that deployment process includes all the setup and configuring, warming up caches,
27
- cleaning cache, all configuration environment required, setting of permissions, run of
28
- cron jobs, etc. All these before, during and after the deployment should be kept in
29
- mind to properly deploy a working Symfony2 application.
35
+ Don't forget that deploying your application also involves updating any dependency (via
36
+ composer), migrating your database, and clearing your cache. You may even need permission
37
+ management, and the ability to add, edit, or remove cron jobs.
30
38
31
- Deployment of large applications require care. The use of staging, testing, QA,
32
- continuous integration, database migrations and capability to roll back in case of failure
33
- is strongly advised. There are simple and more complex tools and one can make
34
- the deployment as easy or sophisticated. Here we present only a few popular on the map:
39
+ Next, we will take a look at some of the more popular options.
35
40
36
41
The Tools
37
42
---------
38
43
39
44
`Capifony `_:
40
45
41
- This tool is a deployment recipe on top of capistrano for Symfony2 project
46
+ This tool is a deployment recipe on top of Capistrano for Symfony2 project
42
47
43
48
`Magallanes `_:
44
49
45
- This tool is probably the one top php deployment tool capistrano -like for deploying any kind of php project
50
+ This tool is probably the one top php deployment tool Capistrano -like for deploying any kind of php project
46
51
47
52
`sf2debpkg `_:
48
53
49
- This tool helps you build a native debian package for your symfony project
54
+ This tool helps you build a native Debian package for your symfony project
50
55
51
56
Bundles:
52
57
53
58
There are `listings `_ of bundles for deployment you can search and use
54
59
55
60
Basic scripting:
56
61
57
- You can of course use shell, `ant `_, or other build tool to script the deploying of your project
62
+ You can of course use shell, `Ant `_, or other build tool to script the deploying of your project
58
63
59
64
Deployment services:
60
65
61
- Some services require a single file in project's git repository like `pagodabox `_ to handle all deployment
66
+ Some services require a single file in project's git repository like `PagodaBox `_ to handle all deployment
62
67
63
68
64
69
.. tip ::
@@ -67,7 +72,7 @@ Deployment services:
67
72
68
73
.. _`Capifony` : https://capifony.org/
69
74
.. _`sf2debpkg` : https://github.com/liip/sf2debpkg
70
- .. _`ant ` : http://blog.sznapka.pl/deploying-Symfony2 -applications-with-ant
71
- .. _`pagodabox ` : https://github.com/jmather/pagoda-symfony-sonata-distribution/blob/master/Boxfile
75
+ .. _`Ant ` : http://blog.sznapka.pl/deploying-symfony2 -applications-with-ant
76
+ .. _`PagodaBox ` : https://github.com/jmather/pagoda-symfony-sonata-distribution/blob/master/Boxfile
72
77
.. _`Magallanes` : https://github.com/andres-montanez/Magallanes
73
78
.. _`listings` : http://knpbundles.com/search?q=deploy
0 commit comments