Deployment Instructions

Version 2 (Matthew Sears, 10/05/2011 01:51 pm)

1 1 Matthew Sears
h1. Deployment Instructions
2 1 Matthew Sears
3 2 Matthew Sears
Open Design Engine (ODE) uses "Capistrano":http://capistranorb.com for code deployment. Capistrano is a developer tool for deploying web applications. It is typically installed on a workstation, and used to deploy code from your source code management (SCM) to one, or more servers.
4 2 Matthew Sears
5 2 Matthew Sears
h1. Getting started
6 2 Matthew Sears
7 2 Matthew Sears
In order to deploy code to production servers, you must first have authorization to access the server.  The simplest way to achieve access is to use SSH public/private key pairs so that you don't have to type the password each time. Because SSH is the transport for other services such as SCP (secure copy), SFTP (secure file transfer), and other services (SVN, etc), this can be very convenient and save you a lot of typing.
8 2 Matthew Sears
9 2 Matthew Sears
h1. Quick Deploy
10 2 Matthew Sears
11 2 Matthew Sears
To deploy, simply run:
12 2 Matthew Sears
13 2 Matthew Sears
<pre>
14 2 Matthew Sears
cap production deploy
15 2 Matthew Sears
</pre>
16 2 Matthew Sears
17 2 Matthew Sears
This command executes the following steps:
18 2 Matthew Sears
19 2 Matthew Sears
* Pulls in the latest code from the repository
20 2 Matthew Sears
* Copies any configuration data needed by the application.
21 2 Matthew Sears
* Runs the any new database migrations (including plugins).
22 2 Matthew Sears
* Performs a database backup if the database schema changed since the last deploy.
23 2 Matthew Sears
* Restarts the application server.
24 2 Matthew Sears
25 2 Matthew Sears
26 2 Matthew Sears
h1. Rolling Back
27 2 Matthew Sears
28 2 Matthew Sears
If something goes wrong with the deployment, we can rollback to the previous release:
29 2 Matthew Sears
30 2 Matthew Sears
<pre>
31 2 Matthew Sears
cap deploy:rollback
32 2 Matthew Sears
</pre>
33 2 Matthew Sears
34 2 Matthew Sears
The deployment script will keep the last 5 releases as apart of it's deployment process.
35 2 Matthew Sears
36 2 Matthew Sears
h1. Database Back
37 2 Matthew Sears
38 2 Matthew Sears
We can perform a database backup at anytime:
39 2 Matthew Sears
40 2 Matthew Sears
<pre>
41 2 Matthew Sears
cap db:dump 
42 2 Matthew Sears
</pre>