Skip to content
Newer
Older
100644 127 lines (78 sloc) 4.09 KB
c5deb1a @jadb Added project status to README
jadb authored Oct 28, 2011
1 # capcake ![Project status](http://stillmaintained.com/jadb/capcake.png)
6c9e478 @jadb created the basics for developing the gem
jadb authored Nov 14, 2009
2
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
4
5 ## Installation
6
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
8
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
9 # gem install capistrano
10 # gem install capcake -s http://gemcutter.org
6c9e478 @jadb created the basics for developing the gem
jadb authored Nov 14, 2009
11
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
12 For every application you'll want to deploy:
13
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
14 # cd /path/to/app && capify .
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
18 capfile
19 config/deploy.rb
20
6c9e478 @jadb created the basics for developing the gem
jadb authored Nov 14, 2009
21 Prepend your config/deploy.rb with the following lines:
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
22
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
23 require 'rubygems'
24 require 'capcake'
6c9e478 @jadb created the basics for developing the gem
jadb authored Nov 14, 2009
25
bdae270 @jadb updated README w/ the capcake call for path initialization, more accu…
jadb authored Nov 15, 2009
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 Nov 14, 2009
31
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
32 $ cap -T
6c9e478 @jadb created the basics for developing the gem
jadb authored Nov 14, 2009
33
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
38 set :application, "your_app_name"
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
42 set :repository, "git@domain.com:path/to/repo"
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
46 ssh_options[:forward_agent] = true
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
50 server "www.domain.tld", :app, :db, :primary => true
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
51
bdae270 @jadb updated README w/ the capcake call for path initialization, more accu…
jadb authored Nov 15, 2009
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 Nov 14, 2009
53
6017784 edited README to provide directions with deploy.rb template
damien authored Apr 2, 2011
54 set :cake_branch, " "
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
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 Nov 14, 2009
62
9079c02 @damusnet exclude tmp directory from git push in README
damusnet authored Jun 7, 2011
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 Apr 2, 2011
68 ## Alternative Easy Configuration
69
b092432 @damusnet fixed typos
damusnet authored Apr 2, 2011
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 Apr 2, 2011
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 Nov 14, 2009
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 Nov 14, 2009
81 # cap deploy:setup
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
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 Nov 14, 2009
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 accu…
jadb authored Nov 15, 2009
89 [deploy_to]/shared/system
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
90 [deploy_to]/shared/tmp
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
91
92 Finally, deploy:
93
16712bc @jadb fixed soft-tabs causing markdown not to render codeblocks
jadb authored Nov 14, 2009
94 # cap deploy
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
95
bdae270 @jadb updated README w/ the capcake call for path initialization, more accu…
jadb authored Nov 15, 2009
96 Which will change the directory structure to become:
b2e3000 @jadb updated README w/ full instructions (installation to deployment)
jadb authored Nov 14, 2009
97
f4c1a0d @jadb fixed markdown block in README
jadb authored Nov 15, 2009
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 Nov 14, 2009
108
040515e @jadb Added "Credits" to README
jadb authored Oct 28, 2011
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 Jan 27, 2012
113 * [damusnet](https://github.com/damusnet) (capcake code)
040515e @jadb Added "Credits" to README
jadb authored Oct 28, 2011
114 * [Michael Franze](http://github.com/franzem) (capcake wiki)
115
2a6a8a6 @jadb updated README w/ patches & feedback instructions
jadb authored Jan 17, 2010
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 Nov 14, 2009
124 ## Bugs & Feedback
125
6017784 edited README to provide directions with deploy.rb template
damien authored Apr 2, 2011
126 http://github.com/jadb/capcake/issues
Something went wrong with that request. Please try again.