Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 127 lines (78 sloc) 4.188 kb
c5deb1a @jadb Added project status to README
jadb authored
1 # capcake ![Project status](http://stillmaintained.com/jadb/capcake.png)
6c9e478 @jadb created the basics for developing the gem
jadb authored
2
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
3 Looking to deploy a [CakePHP](http://cakephp.org) application you've built? Capcake extends [Capistrano](http://capify.org), removing the *rails-ism*, replacing them by more *cake-ish* ones.
6c9e478 @jadb created the basics for developing the gem
jadb authored
4
5 ## Installation
6
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
7 If you don't have Capistrano and/or Capcake already installed (basically, just the 1st time):
6c9e478 @jadb created the basics for developing the gem
jadb authored
8
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
9 # gem install capistrano
10 # gem install capcake -s http://gemcutter.org
6c9e478 @jadb created the basics for developing the gem
jadb authored
11
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
12 For every application you'll want to deploy:
13
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
14 # cd /path/to/app && capify .
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
15
16 This will create the following files in your project (don't forget to commit them!):
17
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
18 capfile
19 config/deploy.rb
20
6c9e478 @jadb created the basics for developing the gem
jadb authored
21 Prepend your config/deploy.rb with the following lines:
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
22
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
23 require 'rubygems'
24 require 'capcake'
6c9e478 @jadb created the basics for developing the gem
jadb authored
25
bdae270 @jadb updated README w/ the capcake call for path initialization, more accurat...
jadb authored
26 And make sure you start capcake on the last line of that same file:
27
28 capcake
29
30 You should then be able to proceed as you usually would. To familiarize yourself with the now modified list of tasks, you can get a full list with:
6c9e478 @jadb created the basics for developing the gem
jadb authored
31
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
32 $ cap -T
6c9e478 @jadb created the basics for developing the gem
jadb authored
33
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
34 ## Configuration
35
36 Before continuing, some changes to config/deploy.rb are necessary. First, your project's name:
37
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
38 set :application, "your_app_name"
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
39
40 Next, setting up the Git repository (make sure it's accessible by both your local machine and server your are deploying to):
41
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
42 set :repository, "git@domain.com:path/to/repo"
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
43
44 Now, to deploy from Git, and by following [GitHub's suggestion](http://github.com/guides/deploying-with-capistrano) (they must know what they are talking about), add a user (defaults to *deployer* by capcake's recipe) to your server(s) just for deployments. In this example, I will be using SSH keys instead of getting a Git password prompt. Local user's SSH key must be added to *deployer*'s ~/.ssh/authorized_keys for this to work as described.
45
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
46 ssh_options[:forward_agent] = true
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
47
48 We need to tell it where to deploy, using what methods:
49
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
50 server "www.domain.tld", :app, :db, :primary => true
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
51
bdae270 @jadb updated README w/ the capcake call for path initialization, more accurat...
jadb authored
52 And finally, some CakePHP related settings (if omitted, Capcake will NOT handle deploying CakePHP):
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
53
6017784 edited README to provide directions with deploy.rb template
damien authored
54 set :cake_branch, " "
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
55
56 You can change the default values for the following variables also:
57
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
58 set :cake_branch, "1.2"
59 set :cake_path, "/path/to"
60 set :user, "your_username"
61 set :branch, "tag"
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
62
9079c02 @damusnet exclude tmp directory from git push in README
damusnet authored
63 Append the following lines to your .git/info/exclude file:
64
65 .DS_Store
66 tmp/*
67
6017784 edited README to provide directions with deploy.rb template
damien authored
68 ## Alternative Easy Configuration
69
b092432 @damusnet fixed typos
damusnet authored
70 Simply replace your deploy.rb configuration file with the one provided in the template directory, and change all variables on the lines that have comments with your values.
6017784 edited README to provide directions with deploy.rb template
damien authored
71
72 This configuration file is meant to work with [Multiple Stages Without Multistage Extension](https://github.com/capistrano/capistrano/wiki/2.x-Multiple-Stages-Without-Multistage-Extension) so every cap command will have to contain the stage you want to deploy to. For instance:
73
74 $ cap staging deploy:setup
75 $ cap staging deploy
76
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
77 ## Deployment
78
79 The first time you are deploying, you need to run:
80
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
81 # cap deploy:setup
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
82
83 That should create on your server the following directory structure:
84
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
85 [deploy_to]
86 [deploy_to]/releases
87 [deploy_to]/shared
88 [deploy_to]/shared/cakephp
bdae270 @jadb updated README w/ the capcake call for path initialization, more accurat...
jadb authored
89 [deploy_to]/shared/system
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
90 [deploy_to]/shared/tmp
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
91
92 Finally, deploy:
93
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored
94 # cap deploy
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
95
bdae270 @jadb updated README w/ the capcake call for path initialization, more accurat...
jadb authored
96 Which will change the directory structure to become:
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
97
f4c1a0d @jadb fixed markdown block in README
jadb authored
98 [deploy_to]
99 [deploy_to]/current -> [deploy_to]/releases/20091013001122
100 [deploy_to]/releases
101 [deploy_to]/releases/20091013001122
102 [deploy_to]/releases/20091013001122/system -> [deploy_to]/shared/system
103 [deploy_to]/releases/20091013001122/tmp -> [deploy_to]/shared/tmp
104 [deploy_to]/shared
105 [deploy_to]/shared/cakephp
106 [deploy_to]/shared/system
107 [deploy_to]/shared/tmp
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored
108
040515e @jadb Added "Credits" to README
jadb authored
109 ## Credits
110
111 * Jamis Buck ([Capistrano's](https://github.com/capistrano) original author)
112 * [Jad Bitar](http://github.com/jadb) (capcake code)
111e017 @jadb Added credit to damusnet
jadb authored
113 * [damusnet](https://github.com/damusnet) (capcake code)
040515e @jadb Added "Credits" to README
jadb authored
114 * [Michael Franze](http://github.com/franzem) (capcake wiki)
115
2a6a8a6 @jadb updated README w/ patches & feedback instructions
jadb authored
116 ## Patches & Features
117
118 * Fork
119 * Mod, fix
120 * Test - this is important, so it's not unintentionally broken
121 * Commit - do not mess with license, todo, version, etc. (if you do change any, make them into commits of their own that I can ignore when I pull)
122 * Pull request - bonus point for topic branches
123
6c9e478 @jadb created the basics for developing the gem
jadb authored
124 ## Bugs & Feedback
125
6017784 edited README to provide directions with deploy.rb template
damien authored
126 http://github.com/jadb/capcake/issues
Something went wrong with that request. Please try again.