deprec 1.9.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +280 -0
- data/COPYING +19 -0
- data/LICENSE +339 -0
- data/README +152 -0
- data/THANKS +17 -0
- data/bin/depify +128 -0
- data/docs/EXAMPLE-installing_tracks.txt +41 -0
- data/docs/README.nagios +22 -0
- data/docs/README.rails +17 -0
- data/docs/config_gen_explained.txt +39 -0
- data/docs/{README.quickstart → deprec-1.x/deprec-1.x.quickstart} +4 -1
- data/docs/{building_edge_capistrano.txt → deprec-1.x/notes.txt} +6 -3
- data/docs/old/deprec_banner.gif +0 -0
- data/docs/windows_linux.txt +350 -0
- data/docs/xen/traffic_monitoring_with_vnstat.txt +95 -0
- data/docs/xen/xen-tools-notes.txt +31 -0
- data/docs/xen/xen_on_hardy.txt +39 -0
- data/lib/deprec.rb +8 -1
- data/lib/deprec/capistrano_extensions.rb +442 -0
- data/lib/deprec/recipes.rb +50 -233
- data/lib/deprec/recipes/aoe.rb +79 -0
- data/lib/deprec/recipes/app/mongrel.rb +213 -0
- data/lib/deprec/recipes/app/passenger.rb +197 -0
- data/lib/deprec/recipes/apt_mirror.rb +99 -0
- data/lib/deprec/recipes/ar_sendmail.rb +67 -0
- data/lib/deprec/recipes/canonical.rb +68 -0
- data/lib/deprec/recipes/db/mysql.rb +144 -0
- data/lib/deprec/recipes/db/postgresql.rb +104 -0
- data/lib/deprec/recipes/db/sqlite.rb +37 -0
- data/lib/deprec/recipes/ddclient.rb +51 -0
- data/lib/deprec/recipes/deprec.rb +199 -0
- data/lib/deprec/recipes/deprecated.rb +71 -0
- data/lib/deprec/recipes/example.rb +115 -0
- data/lib/deprec/recipes/git.rb +97 -0
- data/lib/deprec/recipes/gitosis.rb +48 -0
- data/lib/deprec/recipes/heartbeat.rb +138 -0
- data/lib/deprec/recipes/logrotate.rb +54 -0
- data/lib/deprec/recipes/lvm.rb +20 -0
- data/lib/deprec/recipes/memcache.rb +6 -2
- data/lib/deprec/recipes/monit.rb +143 -0
- data/lib/deprec/recipes/nagios.rb +305 -0
- data/lib/deprec/recipes/network.rb +93 -0
- data/lib/deprec/recipes/ntp.rb +103 -0
- data/lib/deprec/recipes/php.rb +58 -0
- data/lib/deprec/recipes/postfix.rb +115 -0
- data/lib/deprec/recipes/rails.rb +300 -55
- data/lib/deprec/recipes/ruby/mri.rb +55 -0
- data/lib/deprec/recipes/ruby/ree.rb +41 -0
- data/lib/deprec/recipes/sphinx.rb +86 -0
- data/lib/deprec/recipes/ssh.rb +85 -18
- data/lib/deprec/recipes/ssl.rb +55 -0
- data/lib/deprec/recipes/starling.rb +119 -0
- data/lib/deprec/recipes/svn.rb +163 -183
- data/lib/deprec/recipes/trac.rb +239 -62
- data/lib/deprec/recipes/ubuntu.rb +18 -100
- data/lib/deprec/recipes/users.rb +90 -0
- data/lib/deprec/recipes/utils.rb +58 -0
- data/lib/deprec/recipes/vnstat.rb +85 -0
- data/lib/deprec/recipes/web/apache.rb +119 -0
- data/lib/deprec/recipes/web/nginx.rb +172 -0
- data/lib/deprec/recipes/wordpress.rb +96 -0
- data/lib/deprec/recipes/wpmu.rb +103 -0
- data/lib/deprec/recipes/xen.rb +267 -0
- data/lib/deprec/recipes/xentools.rb +75 -0
- data/lib/deprec/templates/aoe/aoe-init +55 -0
- data/lib/deprec/templates/aoe/fence_aoemask +351 -0
- data/lib/deprec/templates/apache/namevirtualhosts.conf +5 -0
- data/lib/deprec/templates/apt/sources.list +18 -0
- data/lib/deprec/templates/apt_mirror/apt-mirror-cron +4 -0
- data/lib/deprec/templates/apt_mirror/mirror.list +33 -0
- data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
- data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
- data/lib/deprec/templates/ddclient/ddclient.conf.erb +11 -0
- data/lib/deprec/templates/ddclient/ddclient.erb +15 -0
- data/lib/deprec/templates/deprec/caprc.erb +14 -0
- data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
- data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
- data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
- data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
- data/lib/deprec/templates/mongrel/apache_vhost.erb +148 -0
- data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
- data/lib/deprec/{third_party/mongrel_cluster/resources/mongrel_cluster → templates/mongrel/mongrel_cluster-init-script} +19 -6
- data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
- data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
- data/lib/deprec/templates/mongrel/nginx_vhost.erb +41 -0
- data/lib/deprec/templates/monit/monit-init-script +104 -0
- data/lib/deprec/templates/monit/monitrc.erb +227 -0
- data/lib/deprec/templates/monit/nothing +0 -0
- data/lib/deprec/templates/mysql/create_databases.sql +20 -0
- data/lib/deprec/templates/mysql/database.yml.prod +6 -0
- data/lib/deprec/templates/mysql/database.yml.stage +6 -0
- data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
- data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
- data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
- data/lib/deprec/templates/nagios/cgi.cfg.erb +321 -0
- data/lib/deprec/templates/nagios/check_linux_free_memory.pl +118 -0
- data/lib/deprec/templates/nagios/check_mongrel_cluster.rb +82 -0
- data/lib/deprec/templates/nagios/commands.cfg.erb +240 -0
- data/lib/deprec/templates/nagios/contacts.cfg.erb +57 -0
- data/lib/deprec/templates/nagios/hosts.cfg.erb +143 -0
- data/lib/deprec/templates/nagios/htpasswd.users +1 -0
- data/lib/deprec/templates/nagios/localhost.cfg.erb +157 -0
- data/lib/deprec/templates/nagios/nagios.cfg.erb +1274 -0
- data/lib/deprec/templates/nagios/nagios_apache_vhost.conf.erb +45 -0
- data/lib/deprec/templates/nagios/nrpe.cfg.erb +210 -0
- data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
- data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
- data/lib/deprec/templates/nagios/services.cfg.erb +79 -0
- data/lib/deprec/templates/nagios/templates.cfg.erb +9 -0
- data/lib/deprec/templates/nagios/timeperiods.cfg.erb +94 -0
- data/lib/deprec/templates/network/hostname.erb +1 -0
- data/lib/deprec/templates/network/hosts.erb +2 -0
- data/lib/deprec/templates/network/interfaces.erb +18 -0
- data/lib/deprec/templates/network/resolv.conf.erb +6 -0
- data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
- data/lib/deprec/templates/nginx/mime.types.erb +70 -0
- data/lib/deprec/templates/nginx/nginx-init-script +62 -0
- data/lib/deprec/templates/nginx/nginx.conf.erb +125 -0
- data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
- data/lib/deprec/templates/nginx/nothing.conf +1 -0
- data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +41 -0
- data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
- data/lib/deprec/templates/passenger/apache_vhost.erb +21 -0
- data/lib/deprec/templates/passenger/passenger.conf.erb +21 -0
- data/lib/deprec/templates/passenger/passenger.load.erb +3 -0
- data/lib/deprec/templates/postfix/aliases.erb +3 -0
- data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
- data/lib/deprec/templates/{postfix_main.conf → postfix/main.cf.erb} +6 -8
- data/lib/deprec/templates/postfix/master.cf.erb +77 -0
- data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
- data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
- data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
- data/lib/deprec/templates/ssl/make-ssl-cert +138 -0
- data/lib/deprec/templates/ssl/ssl-cert-snakeoil.key +15 -0
- data/lib/deprec/templates/ssl/ssl-cert-snakeoil.pem +19 -0
- data/lib/deprec/templates/starling/monit.conf.erb +14 -0
- data/lib/deprec/templates/starling/starling-init-script.erb +71 -0
- data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
- data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
- data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
- data/lib/deprec/templates/trac/trac.ini.erb +169 -0
- data/lib/deprec/templates/trac/trac_deprec.png +0 -0
- data/lib/deprec/templates/trac/tracd-init.erb +43 -0
- data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
- data/lib/deprec/templates/vnstat/config.php +57 -0
- data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +31 -0
- data/lib/deprec/templates/wordpress/wp-config.php.erb +31 -0
- data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +13 -0
- data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
- data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
- data/lib/deprec/templates/xen/xend-init.erb +57 -0
- data/lib/deprec/templates/xen/xendomains.erb +137 -0
- data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
- data/lib/deprec/templates/xentools/40-setup-networking +145 -0
- data/lib/deprec/templates/xentools/xen-tools.conf.erb +276 -0
- data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
- data/lib/deprec_cmd_completion.sh +26 -0
- data/lib/vmbuilder_plugins/all.rb +20 -0
- data/lib/vmbuilder_plugins/apt.rb +93 -0
- data/lib/vmbuilder_plugins/emerge.rb +76 -0
- data/lib/{deprec/third_party/vmbuilder/plugins → vmbuilder_plugins}/gem.rb +10 -17
- data/lib/{deprec/third_party/vmbuilder/plugins → vmbuilder_plugins}/std.rb +69 -19
- metadata +204 -55
- data/bin/deprec +0 -35
- data/docs/README.slicehost +0 -14
- data/docs/README.svn_trac +0 -19
- data/lib/deprec/capistrano_extensions/actor_extensions.rb +0 -89
- data/lib/deprec/capistrano_extensions/cli_extensions.rb +0 -38
- data/lib/deprec/capistrano_extensions/deprec_extensions.rb +0 -137
- data/lib/deprec/generators/deprec/USAGE +0 -11
- data/lib/deprec/generators/deprec/deprec_generator.rb +0 -24
- data/lib/deprec/generators/deprec/templates/deploy.rb +0 -90
- data/lib/deprec/generators/loader.rb +0 -20
- data/lib/deprec/recipes/apache.rb +0 -91
- data/lib/deprec/recipes/cache_svn.rb +0 -74
- data/lib/deprec/recipes/vmware.rb +0 -114
- data/lib/deprec/templates/trac.ini.erb +0 -106
- data/lib/deprec/third_party/THIRD_PARTY_README +0 -12
- data/lib/deprec/third_party/mongrel_cluster/LICENSE +0 -506
- data/lib/deprec/third_party/mongrel_cluster/recipes.rb +0 -96
- data/lib/deprec/third_party/railsmachine/LICENSE +0 -506
- data/lib/deprec/third_party/railsmachine/recipes/apache.rb +0 -92
- data/lib/deprec/third_party/railsmachine/recipes/mysql.rb +0 -73
- data/lib/deprec/third_party/railsmachine/recipes/templates/httpd-ssl.conf +0 -80
- data/lib/deprec/third_party/railsmachine/recipes/templates/httpd.conf +0 -57
- data/lib/deprec/third_party/vmbuilder/plugins.rb +0 -8
- data/lib/deprec/third_party/vmbuilder/plugins/apt.rb +0 -144
- data/resources/capistrano_include_dotfiles.patch +0 -17
data/README
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
------------------------------------------
|
2
|
+
deprec - Deployment Recipes for Capistrano
|
3
|
+
------------------------------------------
|
4
|
+
|
5
|
+
== Introduction
|
6
|
+
|
7
|
+
The deprec [1] gem is a set of tasks for Capistrano [2]. These tasks provide
|
8
|
+
for the installation, configuration and control of system services on servers
|
9
|
+
running Ubuntu linux. Deprec was created in 2006 by Mike Bailey to setup an
|
10
|
+
environment for running Ruby on Rails web applications on Ubuntu servers. Since
|
11
|
+
then its uses have grown to installing Xen virtualization, mail, monitoring, high
|
12
|
+
availability IP failover and other services.
|
13
|
+
|
14
|
+
The tasks are run at the command line on your workstation and connect to
|
15
|
+
remote servers via ssh to run commands and copy out files.
|
16
|
+
|
17
|
+
Deprec-2.x is a complete rewrite of the project that achieves the following:
|
18
|
+
|
19
|
+
- support for Capistrano 2
|
20
|
+
- generated config files are stored locally to enable editing and version control
|
21
|
+
- support for more services (heartbeat, nagios, nginx, ntp, postfix, etc)
|
22
|
+
- multiple Rails deployment options (Passenger+Apache, Mongrel+Apache/Nginx)
|
23
|
+
- creation of a standard base set of task names
|
24
|
+
- tasks are cleanly separated into namespaced units (one file per service)
|
25
|
+
- interactive prompting for missing config values
|
26
|
+
|
27
|
+
Deprec and Capistrano are written in the Ruby programming language [3] however
|
28
|
+
no knowledge of Ruby is required to use it. Users should be able to write
|
29
|
+
new tasks and modify existing options without prior knowledge of Ruby.
|
30
|
+
|
31
|
+
|
32
|
+
== Installation
|
33
|
+
|
34
|
+
Deprec can be obtained from rubyforge[4] and installed using rubygems[5].
|
35
|
+
|
36
|
+
sudo gem install deprec # installs deprec and dependancies
|
37
|
+
cap depify . # creates ~/.caprc which you may edit
|
38
|
+
cap -T # should list lots of deprec tasks
|
39
|
+
|
40
|
+
The .caprc file is loaded every time you use Capistrano. It in turn loads
|
41
|
+
the deprec tasks so you always have them available. Editing the .caprc file
|
42
|
+
in your home directory allows you to specify the location of your ssh key
|
43
|
+
and enable some other useful options (documented in the comments). You can
|
44
|
+
also put tasks here that you want access to, regardless of the current working
|
45
|
+
directory.
|
46
|
+
|
47
|
+
|
48
|
+
== Getting a Ruby on Rails app running on a fresh Ubuntu server
|
49
|
+
|
50
|
+
This is still what brings people to deprec. You can install a full Rails stack
|
51
|
+
and get multiple apps running on it in much less time than it would take to
|
52
|
+
do it manually (e.g. an hour vs. a weekend).
|
53
|
+
|
54
|
+
Get your app running on a fresh Ubuntu (7.10, 8.04) server with these commands:
|
55
|
+
|
56
|
+
cd your_rails_app
|
57
|
+
depify .
|
58
|
+
# Edit config/deploy.rb
|
59
|
+
cap deprec:rails:install_stack
|
60
|
+
|
61
|
+
# WARNING! Don't run the following command if you are using a shared
|
62
|
+
# database server that has already been installed.
|
63
|
+
cap deprec:db:install
|
64
|
+
|
65
|
+
cap deploy:setup
|
66
|
+
cap deploy
|
67
|
+
cap deploy:migrate
|
68
|
+
|
69
|
+
Recorded times for complete install on Ubuntu hardy server (7.10 amd64)
|
70
|
+
|
71
|
+
* Passenger+REE+Apache : 14m29s
|
72
|
+
* Passenger+ruby-1.8.7+Apache : 17m51s
|
73
|
+
* nginx+mongrel : 16m25s
|
74
|
+
|
75
|
+
Note you can choose combinations of:
|
76
|
+
|
77
|
+
* Ruby Enterprise Edition or ruby-1.8.7
|
78
|
+
* Passenger or mongrel (passenger requires you choose to the apache option)
|
79
|
+
* Apache or nginx
|
80
|
+
|
81
|
+
You can find documentation on the deprec site. http://www.deprec.org/
|
82
|
+
|
83
|
+
|
84
|
+
== Installing other things
|
85
|
+
|
86
|
+
I plan to document other things I use deprec for on http://www.deprec.org/.
|
87
|
+
Feel free to poke around and see what's there. I use deprec to provision and
|
88
|
+
manage servers so you might find some things in there I haven't documented. Lucky you.
|
89
|
+
|
90
|
+
|
91
|
+
== Disclaimer
|
92
|
+
|
93
|
+
The tasks run commands that may make changes to your workstation and remote server.
|
94
|
+
You are advised to read the source and use at your own risk.
|
95
|
+
|
96
|
+
|
97
|
+
== Credits
|
98
|
+
|
99
|
+
Deprec is written and maintained by Mike Bailey <mike@bailey.net.au>.
|
100
|
+
More about me here: [http://mike.bailey.net.au/]
|
101
|
+
|
102
|
+
Deprec was inspired and uses the brilliantly executed Capistrano. Thanks Jamis!
|
103
|
+
This gem includes a modified copy of Neil Wilson's very useful vmbuilder_plugins gem.
|
104
|
+
|
105
|
+
|
106
|
+
== Thanks
|
107
|
+
|
108
|
+
Deprec wouldn't be what it is without the contributions of many people, a few of whom are listed here:
|
109
|
+
|
110
|
+
Square Circle Triangle: commissioned work that has included in the project.
|
111
|
+
Eric Harris-Braun: great testing, bug reports and suggestions
|
112
|
+
Gus Gollings: helped restore www.deprec.org
|
113
|
+
Craig Ambrose: testing, documentation and beer
|
114
|
+
|
115
|
+
github forks of note:
|
116
|
+
isaac
|
117
|
+
paulreimer
|
118
|
+
jasherai
|
119
|
+
saimonmoore
|
120
|
+
zippy
|
121
|
+
|
122
|
+
|
123
|
+
== License
|
124
|
+
|
125
|
+
Deprec is licenced under the GPL. This means that you can use it in commercial
|
126
|
+
or open source applications. More details found here:
|
127
|
+
http://www.gnu.org/licenses/gpl.html
|
128
|
+
|
129
|
+
deprec - deployment recipes for capistrano
|
130
|
+
Copyright (C) 2006-2008 Mike Bailey
|
131
|
+
|
132
|
+
This program is free software; you can redistribute it and/or
|
133
|
+
modify it under the terms of the GNU General Public License
|
134
|
+
as published by the Free Software Foundation; either version 2
|
135
|
+
of the License, or (at your option) any later version.
|
136
|
+
|
137
|
+
This program is distributed in the hope that it will be useful,
|
138
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
139
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
140
|
+
GNU General Public License for more details.
|
141
|
+
|
142
|
+
You should have received a copy of the GNU General Public License
|
143
|
+
along with this program; if not, write to the Free Software
|
144
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
145
|
+
|
146
|
+
|
147
|
+
[1] http://www.deprec.org/
|
148
|
+
[2] http://www.capify.org/
|
149
|
+
[3] http://www.ruby-lang.org/en/
|
150
|
+
[4] http://rubyforge.org/
|
151
|
+
[5] http://rubygems.org/
|
152
|
+
[6] http://www.sct.com.au/
|
data/THANKS
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Big thanks go to the following people. Apologies to any I have missed! - Mike
|
2
|
+
|
3
|
+
20080226 Chris Turner for an excellent HOWTO http://crackthenut.cracklabs.com/deprec2-your-slice-from-windows/
|
4
|
+
20080206 Eric Harris-Braun for some great testing, bug reports and suggestions.
|
5
|
+
20071004 Gus Gollings for helping restore www.deprec.org
|
6
|
+
|
7
|
+
Seen on github http://github.com/mbailey/deprec/network
|
8
|
+
|
9
|
+
isaac
|
10
|
+
jasherai Pritesh (London)
|
11
|
+
zippy Eric Harris-Braun (NY) <eric@harris-braun.com> http://eric.harris-braun.com
|
12
|
+
kovacs Michael Kovacs (SF) <michael@mkovacs.com> http://javathehutt.blogspot.com
|
13
|
+
robc Rob Caporetto (Melbourne) rcaporetto@gmail.com http://www.rob-caporetto.com
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
data/bin/depify
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
OptionParser.new do |opts|
|
6
|
+
opts.banner = "Usage: #{File.basename($0)} [path]"
|
7
|
+
|
8
|
+
opts.on("-h", "--help", "Displays this help info") do
|
9
|
+
puts opts
|
10
|
+
exit 0
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
opts.parse!(ARGV)
|
15
|
+
rescue OptionParser::ParseError => e
|
16
|
+
warn e.message
|
17
|
+
puts opts
|
18
|
+
exit 1
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
if ARGV.empty?
|
23
|
+
abort "Please specify the directory to depify, e.g. `#{File.basename($0)} .'"
|
24
|
+
elsif !File.exists?(ARGV.first)
|
25
|
+
abort "`#{ARGV.first}' does not exist."
|
26
|
+
elsif !File.directory?(ARGV.first)
|
27
|
+
abort "`#{ARGV.first}' is not a directory."
|
28
|
+
elsif ARGV.length > 1
|
29
|
+
abort "Too many arguments; please specify only the directory to capify."
|
30
|
+
end
|
31
|
+
|
32
|
+
def unindent(string)
|
33
|
+
indentation = string[/\A\s*/]
|
34
|
+
string.strip.gsub(/^#{indentation}/, "")
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
caprc = unindent(<<-FILE)
|
39
|
+
# .caprc - Capistrano configs (added by deprec gem [www.deprec.org])
|
40
|
+
#
|
41
|
+
# Include settings that you want active whenever you use Capistrano
|
42
|
+
# You can over ride these for particular projects by putting entries
|
43
|
+
# into Capfile or deploy.rb for those projects
|
44
|
+
#
|
45
|
+
# Uncomment any of the following entries to enable them.
|
46
|
+
#
|
47
|
+
# Include deprec - deployment recipes for Capistrano (www.deprec.org)
|
48
|
+
#
|
49
|
+
require 'deprec'
|
50
|
+
|
51
|
+
FILE
|
52
|
+
|
53
|
+
files = {
|
54
|
+
"Capfile" => unindent(<<-FILE),
|
55
|
+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
56
|
+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
57
|
+
Dir['config/*/recipes.rb'].each { |plugin| load(plugin) }
|
58
|
+
load 'config/deploy'
|
59
|
+
FILE
|
60
|
+
|
61
|
+
"config/deploy.rb" => unindent(<<-FILE),
|
62
|
+
require 'deprec'
|
63
|
+
|
64
|
+
set :application, "set your application name here"
|
65
|
+
set :domain, "set domain name project will be served on here"
|
66
|
+
set :repository, "git://github.com/\#{user}/\#{application}.git"
|
67
|
+
|
68
|
+
# If you aren't using Subversion to manage your source code, specify
|
69
|
+
# your SCM below:
|
70
|
+
set :scm, :git
|
71
|
+
|
72
|
+
set :ruby_vm_type, :ree
|
73
|
+
set :web_server_type, :apache
|
74
|
+
set :app_server_type, :passenger
|
75
|
+
set :db_server_type, :mysql
|
76
|
+
|
77
|
+
# set :packages_for_project, %w(libmagick9-dev imagemagick libfreeimage3) # list of packages to be installed
|
78
|
+
# set :gems_for_project, %w(rmagick mini_magick image_science) # list of gems to be installed
|
79
|
+
|
80
|
+
# Update these if you're not running everything on one host.
|
81
|
+
role :app, domain
|
82
|
+
role :web, domain
|
83
|
+
role :db, domain, :primary => true
|
84
|
+
|
85
|
+
# If you aren't deploying to /opt/apps/\#{application} on the target
|
86
|
+
# servers (which is the deprec default), you can specify the actual location
|
87
|
+
# via the :deploy_to variable:
|
88
|
+
# set :deploy_to, "/opt/apps/\#{application}"
|
89
|
+
|
90
|
+
namespace :deploy do
|
91
|
+
task :restart, :roles => :app, :except => { :no_release => true } do
|
92
|
+
top.deprec.app.restart
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
FILE
|
97
|
+
}
|
98
|
+
|
99
|
+
def create_file(file, content)
|
100
|
+
if !File.exists?(File.dirname(file))
|
101
|
+
puts "[add] creating directory `#{File.dirname(file)}'"
|
102
|
+
Dir.mkdir(File.dirname(file))
|
103
|
+
end
|
104
|
+
if File.exists?(file)
|
105
|
+
warn "[skip] `#{file}' already exists"
|
106
|
+
elsif File.exists?(file.downcase)
|
107
|
+
warn "[skip] `#{file.downcase}' exists, which could conflict with `#{file}'"
|
108
|
+
else
|
109
|
+
puts "[add] writing `#{file}'"
|
110
|
+
File.open(file, "w") { |f| f.write(content) }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
create_file(File.join(ENV['HOME'], '.caprc'), caprc)
|
115
|
+
|
116
|
+
base = ARGV.shift
|
117
|
+
config_dir = File.join(base,'config')
|
118
|
+
if File.directory?(config_dir)
|
119
|
+
files.each do |file, content|
|
120
|
+
create_file(File.join(base, file), content)
|
121
|
+
end
|
122
|
+
else
|
123
|
+
warn "[warn] directory `#{config_dir}' does not exist"
|
124
|
+
warn "[skip] '#{base}/Capfile'"
|
125
|
+
warn "[skip] '#{base}/config/deploy.rb'"
|
126
|
+
end
|
127
|
+
|
128
|
+
puts "[done] depified!"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# Install tracks locally
|
3
|
+
#
|
4
|
+
git clone git://github.com/bsag/tracks.git
|
5
|
+
cd tracks
|
6
|
+
|
7
|
+
cp config/database.yml.tmpl config/database.yml
|
8
|
+
cp config/site.yml.tmpl config/site.yml
|
9
|
+
cp -r log.tmpl log -u
|
10
|
+
rake db:create
|
11
|
+
rake db:migrate
|
12
|
+
./script/server # Test locally
|
13
|
+
|
14
|
+
|
15
|
+
#
|
16
|
+
# Install deprec
|
17
|
+
#
|
18
|
+
sudo gem install deprec
|
19
|
+
cap deprec:users:passwd HOSTS=192.168.0.135 USER=root # Change root password
|
20
|
+
cap deprec:users:add HOSTS=192.168.0.135 USER=root # Add personal account
|
21
|
+
|
22
|
+
|
23
|
+
#
|
24
|
+
# Create deploy.rb file for tracks
|
25
|
+
#
|
26
|
+
depify .
|
27
|
+
curl -o config/deploy.rb http://mbailey.github.com/deprec/deploy.rb-tracks
|
28
|
+
# Edit config/deploy.rb specifying the domain name to serve the app on.
|
29
|
+
|
30
|
+
|
31
|
+
#
|
32
|
+
# Install on remote server
|
33
|
+
#
|
34
|
+
|
35
|
+
cap deprec:rails:install_stack
|
36
|
+
cap deprec:db:install
|
37
|
+
cap deploy:setup
|
38
|
+
cap deploy
|
39
|
+
cap deploy:migrate
|
40
|
+
|
41
|
+
# Tracks is now running on your server. Enjoy!
|
data/docs/README.nagios
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
deprec: Install and configure Nagios on Ubuntu 7.10 (gutsy), 8.04 (hardy)
|
2
|
+
=========================================================================
|
3
|
+
|
4
|
+
* Quickstart
|
5
|
+
|
6
|
+
# You need the following item defined in config/deploy.rb (or ~/.caprc)
|
7
|
+
role :nagios, 'monitor.blah.com'
|
8
|
+
|
9
|
+
# Run the following on your workstation
|
10
|
+
export HOSTS=nagios.domain.name # replace with desired domain
|
11
|
+
cap deprec:apache:install
|
12
|
+
cap deprec:nagios:install
|
13
|
+
cap deprec:nagios_plugins:install
|
14
|
+
cap deprec:nagios:config_gen
|
15
|
+
cap deprec:nagios:htpass # create web logins
|
16
|
+
cap deprec:nagios:config
|
17
|
+
cap deprec:apache:restart
|
18
|
+
|
19
|
+
|
20
|
+
* The detail
|
21
|
+
|
22
|
+
TBC
|
data/docs/README.rails
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
deprec: Install Ruby on Rails app on fresh Ubuntu 7.10 (gutsy), 8.04 (hardy)
|
2
|
+
============================================================================
|
3
|
+
|
4
|
+
* Quickstart
|
5
|
+
|
6
|
+
cd your_rails_app
|
7
|
+
depify .
|
8
|
+
# Edit config/deploy.rb
|
9
|
+
cap deprec:rails:install_stack
|
10
|
+
|
11
|
+
# WARNING! Don't run the following command if you are using a shared
|
12
|
+
# database server that has already been installed.
|
13
|
+
cap deprec:db:install
|
14
|
+
|
15
|
+
cap deploy:setup
|
16
|
+
cap deploy
|
17
|
+
cap deploy:migrate
|
@@ -0,0 +1,39 @@
|
|
1
|
+
== Configuration
|
2
|
+
|
3
|
+
deprec2 has a two stage process for generating/deploying configuration files.
|
4
|
+
Configuration files for web, app, db servers (and more) are generated from
|
5
|
+
templates and put under the config/ tree in your Rails apps source tree.
|
6
|
+
Alternatively you could create a non-rails-app tree to hold them. The second
|
7
|
+
stage is pushing the files out to the destination servers. This used to be a
|
8
|
+
one stage process in deprec1 however the change has been made so that:
|
9
|
+
|
10
|
+
- all config files for a project can be kept under source control
|
11
|
+
- you can make changes to config files that are not available through deprec
|
12
|
+
|
13
|
+
Many of the settings in these config files are based on values in the projects
|
14
|
+
deploy.rb file. Others reflect defaults in deprec that you can override by adding
|
15
|
+
fields to deploy.rb. This means you may never need to edit the generated config
|
16
|
+
files directly. You can generate a set of config files with the following:
|
17
|
+
|
18
|
+
cap deprec:nginx:config_gen # generates config files for trac from templates
|
19
|
+
|
20
|
+
config_gen is re-runnable and will prompt you before overwriting a file. It will
|
21
|
+
also show you what changes overwriting would make (in diff format) to help you
|
22
|
+
decide whether you want it to do so.
|
23
|
+
|
24
|
+
Changes to service configuration should never be made on the server. Deprec
|
25
|
+
acknowledges this by offering no assistance to people who want to copy config
|
26
|
+
files back from servers. But pushing the files out couldn't be simpler!
|
27
|
+
|
28
|
+
cap deprec:nginx:config # pushes out all config files for nginx
|
29
|
+
|
30
|
+
deprec2 takes into consideration the fact that that some services are used to
|
31
|
+
host more than one application. For example, a webserver will often have one
|
32
|
+
main configuration and a number of virtual host configurations. Monit has a
|
33
|
+
single config file (/etc/monitrc) but will also load other configs it finds in
|
34
|
+
a certain directory (/etc/monit.d).
|
35
|
+
|
36
|
+
When you deploy a Ruby on Rails app with deprec it drops configs for your project
|
37
|
+
into the config/ directory for your project and symlinks them into a shared path
|
38
|
+
on the server. This means you can install multiple apps on a remote server and
|
39
|
+
they shouldn't stop on each other.
|
@@ -1,3 +1,7 @@
|
|
1
|
+
#
|
2
|
+
# Old notes - YMMV
|
3
|
+
#
|
4
|
+
|
1
5
|
== deprec quickstart (with svn, trac and deployment to apache/mongrel/mysql)
|
2
6
|
|
3
7
|
Here are instructions that will take a fresh install of Ubuntu Dapper (6.06.1 server), create a working rails app, create an SVN repository and trac installation for it and deploy it using apache, mongrel and mysql.
|
@@ -7,7 +11,6 @@ to log into the remote server manually. Capistrano does all the work.
|
|
7
11
|
|
8
12
|
- Mike
|
9
13
|
|
10
|
-
|
11
14
|
# Install deprec on workstation
|
12
15
|
sudo gem install deprec --include-dependencies
|
13
16
|
echo 'require "deprec/recipes"' >> ~/.caprc
|
@@ -1,9 +1,12 @@
|
|
1
|
+
# update timezone on gutsy
|
2
|
+
# dpkg-reconfigure tzdata
|
3
|
+
|
4
|
+
|
5
|
+
# Building Edge Capistrano
|
1
6
|
You can build an edge gem by cd'ing to that directory and doing:
|
2
7
|
|
3
8
|
1. svn info. Find the line that says "Revision:" and mark the revision number.
|
4
|
-
|
5
9
|
2. rake PKG_BUILD=<rev> gem. Replace <rev> with the revision number.
|
6
|
-
|
7
10
|
3. Look in the pkg subdirectory. Install that gem file via "gem install pkg/<gem file>"
|
8
11
|
|
9
|
-
- Jamis
|
12
|
+
- Jamis
|