le1t0-deprec 2.1.6.001
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +444 -0
- data/COPYING +19 -0
- data/LICENSE +339 -0
- data/README +154 -0
- data/THANKS +17 -0
- data/bin/depify +139 -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/deprec-1.x/deprec-1.x.quickstart +50 -0
- data/docs/deprec-1.x/notes.txt +12 -0
- 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 +42 -0
- data/lib/deprec/capistrano_extensions.rb +446 -0
- data/lib/deprec/recipes.rb +7 -0
- data/lib/deprec/recipes/aoe.rb +79 -0
- data/lib/deprec/recipes/app/mongrel.rb +213 -0
- data/lib/deprec/recipes/app/passenger.rb +190 -0
- data/lib/deprec/recipes/ar_sendmail.rb +67 -0
- data/lib/deprec/recipes/aspell.rb +22 -0
- data/lib/deprec/recipes/canonical.rb +68 -0
- data/lib/deprec/recipes/cap.rb +39 -0
- data/lib/deprec/recipes/chef.rb +68 -0
- data/lib/deprec/recipes/collectd.rb +112 -0
- data/lib/deprec/recipes/db/couchdb.rb +107 -0
- data/lib/deprec/recipes/db/mysql.rb +194 -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 +167 -0
- data/lib/deprec/recipes/deprecated.rb +71 -0
- data/lib/deprec/recipes/drbd.rb +137 -0
- data/lib/deprec/recipes/dummy.rb +22 -0
- data/lib/deprec/recipes/example.rb +115 -0
- data/lib/deprec/recipes/git.rb +97 -0
- data/lib/deprec/recipes/gitosis.rb.disabled +55 -0
- data/lib/deprec/recipes/glusterfs.rb +176 -0
- data/lib/deprec/recipes/god.rb +70 -0
- data/lib/deprec/recipes/haproxy.rb +115 -0
- data/lib/deprec/recipes/heartbeat.rb +138 -0
- data/lib/deprec/recipes/imagemagick/imagemagick_bin.rb +24 -0
- data/lib/deprec/recipes/imagemagick/imagemagick_src.rb +39 -0
- data/lib/deprec/recipes/integrity.rb +108 -0
- data/lib/deprec/recipes/iptables.rb +94 -0
- data/lib/deprec/recipes/java.rb +23 -0
- data/lib/deprec/recipes/keepalived.rb +78 -0
- data/lib/deprec/recipes/ldap.rb +52 -0
- data/lib/deprec/recipes/logrotate.rb +56 -0
- data/lib/deprec/recipes/lvm.rb +20 -0
- data/lib/deprec/recipes/memcache.rb +49 -0
- data/lib/deprec/recipes/mongodb.rb +94 -0
- data/lib/deprec/recipes/monit.rb +135 -0
- data/lib/deprec/recipes/mysql_proxy.rb +67 -0
- data/lib/deprec/recipes/nagios.rb +361 -0
- data/lib/deprec/recipes/network.rb +116 -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/profiles.rb +125 -0
- data/lib/deprec/recipes/raid/amcc_3ware.rb +21 -0
- data/lib/deprec/recipes/rails.rb +330 -0
- data/lib/deprec/recipes/redhat_cluster.rb +228 -0
- data/lib/deprec/recipes/redis.rb +90 -0
- data/lib/deprec/recipes/ruby/mri.rb +55 -0
- data/lib/deprec/recipes/ruby/ree.rb +40 -0
- data/lib/deprec/recipes/rvm.rb +32 -0
- data/lib/deprec/recipes/s3utils.rb +63 -0
- data/lib/deprec/recipes/sphinx/thinking_sphinx.rb +105 -0
- data/lib/deprec/recipes/sphinx/ultrasphinx.rb +86 -0
- data/lib/deprec/recipes/ssh.rb +147 -0
- data/lib/deprec/recipes/ssl.rb +56 -0
- data/lib/deprec/recipes/starling.rb +119 -0
- data/lib/deprec/recipes/svn.rb +171 -0
- data/lib/deprec/recipes/syslog.rb +63 -0
- data/lib/deprec/recipes/trac.rb.disabled +277 -0
- data/lib/deprec/recipes/tsung.rb +74 -0
- data/lib/deprec/recipes/ubuntu.rb +90 -0
- 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 +143 -0
- data/lib/deprec/recipes/web/nginx.rb +172 -0
- data/lib/deprec/recipes/wordpress.rb.notworking +96 -0
- data/lib/deprec/recipes/wpmu.rb +103 -0
- data/lib/deprec/recipes/xen.rb +364 -0
- data/lib/deprec/recipes/xentools.rb +101 -0
- data/lib/deprec/recipes_minus_rails.rb +125 -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/apache/ports.conf.erb +5 -0
- data/lib/deprec/templates/apache/status.conf.erb +17 -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/chef/chef.json.erb +1 -0
- data/lib/deprec/templates/chef/solo.rb +2 -0
- data/lib/deprec/templates/collectd/collectd-init.d +153 -0
- data/lib/deprec/templates/collectd/collectd.conf.erb +686 -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/drbd/drbd.conf.erb +531 -0
- data/lib/deprec/templates/glusterfs/glusterfsd-init.erb +95 -0
- data/lib/deprec/templates/gnbd_client/cluster.conf.erb +21 -0
- data/lib/deprec/templates/gnbd_client/clvm-default.erb +3 -0
- data/lib/deprec/templates/gnbd_client/cman-default.erb +6 -0
- data/lib/deprec/templates/gnbd_client/gnbdimports.conf.erb +1 -0
- data/lib/deprec/templates/gnbd_server/cluster.conf.erb +20 -0
- data/lib/deprec/templates/gnbd_server/clvm-default.erb +3 -0
- data/lib/deprec/templates/gnbd_server/cman-default.erb +6 -0
- data/lib/deprec/templates/gnbd_server/gnbd-server-default.erb +1 -0
- data/lib/deprec/templates/gnbd_server/gnbdexports.conf.erb +1 -0
- data/lib/deprec/templates/god/god-conf.erb +2 -0
- data/lib/deprec/templates/god/god-init.erb +47 -0
- data/lib/deprec/templates/haproxy/haproxy-init.d +120 -0
- data/lib/deprec/templates/haproxy/haproxy.cfg.erb +31 -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/integrity/apache_vhost.erb +4 -0
- data/lib/deprec/templates/integrity/config.ru.erb +21 -0
- data/lib/deprec/templates/integrity/config.yml.erb +43 -0
- data/lib/deprec/templates/iptables/firewall-default.erb +13 -0
- data/lib/deprec/templates/iptables/firewall-init.erb +171 -0
- data/lib/deprec/templates/keepalived/keepalived.conf.erb +18 -0
- data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
- data/lib/deprec/templates/mongodb/mongodb-init.d +88 -0
- data/lib/deprec/templates/mongrel/apache_vhost.conf.erb +148 -0
- data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
- data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
- 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.conf.erb +41 -0
- data/lib/deprec/templates/monit/monit-init-script +104 -0
- data/lib/deprec/templates/monit/monitrc.erb +250 -0
- data/lib/deprec/templates/monit/nothing.monitrc +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/mysql_proxy/mysql-proxy-default.erb +4 -0
- data/lib/deprec/templates/nagios/README +32 -0
- data/lib/deprec/templates/nagios/cgi.cfg.erb +357 -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/htpasswd.users +1 -0
- data/lib/deprec/templates/nagios/mrtg.cfg +180 -0
- data/lib/deprec/templates/nagios/nagios.cfg.erb +1325 -0
- data/lib/deprec/templates/nagios/nrpe.cfg.erb +222 -0
- data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
- data/lib/deprec/templates/nagios/objects/commands.cfg.erb +265 -0
- data/lib/deprec/templates/nagios/objects/contacts.cfg.erb +89 -0
- data/lib/deprec/templates/nagios/objects/hosts.cfg.erb +114 -0
- data/lib/deprec/templates/nagios/objects/localhost.cfg.erb +116 -0
- data/lib/deprec/templates/nagios/objects/services.cfg.erb +165 -0
- data/lib/deprec/templates/nagios/objects/timeperiods.cfg.erb +94 -0
- data/lib/deprec/templates/nagios/resource.cfg.erb +34 -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 +29 -0
- data/lib/deprec/templates/passenger/logrotate.conf.erb +12 -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.cf.erb +36 -0
- data/lib/deprec/templates/postfix/master.cf.erb +77 -0
- data/lib/deprec/templates/redis/redis-conf.erb +132 -0
- data/lib/deprec/templates/redis/redis-init.erb +50 -0
- data/lib/deprec/templates/s3utils/s3cfg +35 -0
- data/lib/deprec/templates/s3utils/s3config.yml +3 -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/syslog/syslog.conf.erb +71 -0
- data/lib/deprec/templates/syslog/syslogd.erb +13 -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/tsung/tsung.xml.erb +47 -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/100-ubuntu-setup +26 -0
- data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
- data/lib/deprec/templates/xentools/30-disable-gettys +57 -0
- data/lib/deprec/templates/xentools/31-ubuntu-setup +32 -0
- data/lib/deprec/templates/xentools/40-setup-networking +145 -0
- data/lib/deprec/templates/xentools/98-custom +17 -0
- data/lib/deprec/templates/xentools/xen-tools.conf.erb +278 -0
- data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
- data/lib/deprec_cmd_completion.sh +26 -0
- data/lib/deprec_minus_rails.rb +12 -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/vmbuilder_plugins/gem.rb +100 -0
- data/lib/vmbuilder_plugins/std.rb +203 -0
- metadata +304 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
# Copyright 2010 by le1t0@github. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :redis do
|
5
|
+
|
6
|
+
set :redis_user, 'redis'
|
7
|
+
set :redis_group, 'redis'
|
8
|
+
|
9
|
+
SRC_PACKAGES[:redis] = {
|
10
|
+
:md5sum => '0c5355e57606523f9e8ce816db5e542f redis-1.2.6.tar.gz',
|
11
|
+
:filename => 'redis-1.2.6.tar.gz',
|
12
|
+
:dir => 'redis-1.2.6',
|
13
|
+
:url => "http://redis.googlecode.com/files/redis-1.2.6.tar.gz",
|
14
|
+
:unpack => "tar zxf redis-1.2.6.tar.gz;",
|
15
|
+
:make => 'make;',
|
16
|
+
:configure => nil,
|
17
|
+
:install => "install -t /usr/local/bin redis-server redis-benchmark redis-cli redis-stat; install -o #{redis_user} -g #{redis_group} -d /var/lib/redis /var/log/redis"
|
18
|
+
}
|
19
|
+
|
20
|
+
desc "install Redis"
|
21
|
+
task :install do
|
22
|
+
create_redis_user
|
23
|
+
deprec2.download_src(SRC_PACKAGES[:redis], src_dir)
|
24
|
+
deprec2.install_from_src(SRC_PACKAGES[:redis], src_dir)
|
25
|
+
end
|
26
|
+
|
27
|
+
SYSTEM_CONFIG_FILES[:redis] = [
|
28
|
+
|
29
|
+
{:template => "redis-init.erb",
|
30
|
+
:path => '/etc/init.d/redis',
|
31
|
+
:mode => 0755,
|
32
|
+
:owner => 'root:root'},
|
33
|
+
|
34
|
+
{:template => "redis-conf.erb",
|
35
|
+
:path => '/etc/redis/redis.conf',
|
36
|
+
:mode => 0755,
|
37
|
+
:owner => 'root:root'}
|
38
|
+
|
39
|
+
]
|
40
|
+
|
41
|
+
desc <<-DESC
|
42
|
+
Generate redis config from template. Note that this does not
|
43
|
+
push the config to the server, it merely generates required
|
44
|
+
configuration files. These should be kept under source control.
|
45
|
+
The can be pushed to the server with the :config task.
|
46
|
+
DESC
|
47
|
+
task :config_gen do
|
48
|
+
SYSTEM_CONFIG_FILES[:redis].each do |file|
|
49
|
+
deprec2.render_template(:redis, file)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Push redis config files to server"
|
54
|
+
task :config, :roles => :redis do
|
55
|
+
deprec2.push_configs(:redis, SYSTEM_CONFIG_FILES[:redis])
|
56
|
+
end
|
57
|
+
|
58
|
+
task :create_redis_user, :roles => :redis do
|
59
|
+
deprec2.groupadd(redis_group)
|
60
|
+
deprec2.useradd(redis_user, :group => redis_group, :homedir => false)
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Start Redis"
|
64
|
+
task :start, :roles => :redis do
|
65
|
+
send(run_method, "/etc/init.d/redis start")
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Stop Redis"
|
69
|
+
task :stop, :roles => :redis do
|
70
|
+
send(run_method, "/etc/init.d/redis stop")
|
71
|
+
end
|
72
|
+
|
73
|
+
desc "Restart Redis"
|
74
|
+
task :restart, :roles => :redis do
|
75
|
+
send(run_method, "/etc/init.d/redis restart")
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "Set Redis to start on boot"
|
79
|
+
task :activate, :roles => :redis do
|
80
|
+
send(run_method, "update-rc.d redis defaults")
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "Set Redis to not start on boot"
|
84
|
+
task :deactivate, :roles => :redis do
|
85
|
+
send(run_method, "update-rc.d -f redis remove")
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Copyright 2006-2008 by Mike Bailey. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
|
4
|
+
namespace :deprec do
|
5
|
+
namespace :mri do
|
6
|
+
|
7
|
+
SRC_PACKAGES[:mri] = {
|
8
|
+
:md5sum => "18dcdfef761a745ac7da45b61776afa5 ruby-1.8.7-p174.tar.gz",
|
9
|
+
:url => "ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz",
|
10
|
+
:configure => "./configure --with-readline-dir=/usr/local;"
|
11
|
+
}
|
12
|
+
|
13
|
+
desc "Install Ruby"
|
14
|
+
task :install do
|
15
|
+
install_deps
|
16
|
+
deprec2.download_src(SRC_PACKAGES[:mri], src_dir)
|
17
|
+
deprec2.install_from_src(SRC_PACKAGES[:mri], src_dir)
|
18
|
+
top.deprec.rubygems.install
|
19
|
+
end
|
20
|
+
|
21
|
+
task :install_deps do
|
22
|
+
apt.install( {:base => %w(zlib1g-dev libssl-dev libncurses5-dev libreadline5-dev)}, :stable )
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
namespace :deprec do
|
30
|
+
namespace :rubygems do
|
31
|
+
|
32
|
+
SRC_PACKAGES[:rubygems] = {
|
33
|
+
:md5sum => "6e317335898e73beab15623cdd5f8cff rubygems-1.3.5.tgz",
|
34
|
+
:url => "http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz",
|
35
|
+
:configure => "",
|
36
|
+
:make => "",
|
37
|
+
:install => 'ruby setup.rb;'
|
38
|
+
}
|
39
|
+
|
40
|
+
desc "Install Rubygems"
|
41
|
+
task :install do
|
42
|
+
install_deps
|
43
|
+
deprec2.download_src(SRC_PACKAGES[:rubygems], src_dir)
|
44
|
+
deprec2.install_from_src(SRC_PACKAGES[:rubygems], src_dir)
|
45
|
+
# gem2.upgrade # you may not want to upgrade your gems right now
|
46
|
+
end
|
47
|
+
|
48
|
+
# install dependencies for rubygems
|
49
|
+
task :install_deps do
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright 2006-2008 by Mike Bailey. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :ree do
|
5
|
+
set :ree_version, 'ruby-enterprise-1.8.6-20090610'
|
6
|
+
set :ree_install_dir, "/opt/#{ree_version}"
|
7
|
+
set :ree_short_path, '/opt/ruby-enterprise'
|
8
|
+
|
9
|
+
SRC_PACKAGES[:ree] = {
|
10
|
+
:md5sum => "0bf66ee626918464a6eccdd83c99d63a #{ree_version}.tar.gz",
|
11
|
+
:url => "http://rubyforge.org/frs/download.php/58677/#{ree_version}.tar.gz",
|
12
|
+
:configure => '',
|
13
|
+
:make => '',
|
14
|
+
:install => "./installer --auto /opt/#{ree_version}"
|
15
|
+
}
|
16
|
+
|
17
|
+
task :install do
|
18
|
+
install_deps
|
19
|
+
deprec2.download_src(SRC_PACKAGES[:ree], src_dir)
|
20
|
+
deprec2.install_from_src(SRC_PACKAGES[:ree], src_dir)
|
21
|
+
symlink_ree
|
22
|
+
end
|
23
|
+
|
24
|
+
task :install_deps do
|
25
|
+
apt.install({:base => %w(libssl-dev libmysqlclient15-dev libreadline5-dev)}, :stable)
|
26
|
+
end
|
27
|
+
|
28
|
+
task :symlink_ree do
|
29
|
+
sudo "ln -sf /opt/#{ree_version} #{ree_short_path}"
|
30
|
+
sudo "ln -fs #{ree_short_path}/bin/gem /usr/local/bin/gem"
|
31
|
+
sudo "ln -fs #{ree_short_path}/bin/irb /usr/local/bin/irb"
|
32
|
+
sudo "ln -fs #{ree_short_path}/bin/rake /usr/local/bin/rake"
|
33
|
+
sudo "ln -fs #{ree_short_path}/bin/rails /usr/local/bin/rails"
|
34
|
+
sudo "ln -fs #{ree_short_path}/bin/ruby /usr/local/bin/ruby"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright 2010 by le1t0@github. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :rvm do
|
5
|
+
|
6
|
+
set :rvm_rubies, %w(ruby-1.8.7-p160) # First ruby will be set as default if rvm_default_ruby is nil or empty
|
7
|
+
set :rvm_default_ruby, nil
|
8
|
+
|
9
|
+
desc "Install Rvm"
|
10
|
+
task :install do
|
11
|
+
run <<-EOF
|
12
|
+
version=$(curl http://rvm.beginrescueend.com/releases/stable-version.txt) ;
|
13
|
+
mkdir -p ~/.rvm/src/ && curl -O http://rvm.beginrescueend.com/releases/rvm-${version}.tar.gz | tar zxf - && cd rvm-${version} && ./install
|
14
|
+
|
15
|
+
EOF
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Install rubies"
|
19
|
+
task :install_rubies do
|
20
|
+
rvm_rubies.each_with_index do |ruby, i|
|
21
|
+
run "rvm install #{ruby}"
|
22
|
+
run "rvm --default #{ruby}" if i == 0 && (rvm_default_ruby.empty? || rvm_default_ruby.nil?)
|
23
|
+
end
|
24
|
+
if !(rvm_default_ruby.empty? || rvm_default_ruby.nil?)
|
25
|
+
set_default = rvm_default_ruby == "system" ? rvm_default_ruby : "--default #{rvm_default_ruby}"
|
26
|
+
run "rvm #{set_default}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright 2010 by le1t0@github. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :s3utils do
|
5
|
+
|
6
|
+
set :s3utils_bucket_location, 'EU'
|
7
|
+
set :s3utils_calling_format, 'SUBDOMAIN'
|
8
|
+
set :s3utils_access_key, "0123456789ABCDEFGHIJ"
|
9
|
+
set :s3utils_secret_key, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcd"
|
10
|
+
set :s3utils_passphrase, "my_passphrase"
|
11
|
+
|
12
|
+
SRC_PACKAGES[:s3cmd] = {
|
13
|
+
:filename => 's3cmd-0.9.9.91.tar.gz',
|
14
|
+
:dir => 's3cmd-0.9.9.91',
|
15
|
+
:url => "http://sourceforge.net/projects/s3tools/files/s3cmd/0.9.9.91/s3cmd-0.9.9.91.tar.gz/download",
|
16
|
+
:unpack => "tar zxf s3cmd-0.9.9.91.tar.gz;",
|
17
|
+
:configure => 'echo > /dev/null',
|
18
|
+
:make => 'echo > /dev/null',
|
19
|
+
:install => 'cp -a S3 s3cmd /usr/local/bin/ ; cp s3cmd.1 /usr/local/share/man/man1/ ;'
|
20
|
+
}
|
21
|
+
|
22
|
+
# setting it as a class variable makes it initialize too early, making 'user' contain the wrong value!
|
23
|
+
def s3utils_system_config_files
|
24
|
+
[
|
25
|
+
{:template => "s3cfg",
|
26
|
+
:path => "/home/#{user}/.s3cfg",
|
27
|
+
:mode => 0644,
|
28
|
+
:owner => "#{user}:#{user}"},
|
29
|
+
|
30
|
+
{:template => "s3config.yml",
|
31
|
+
:path => "/home/#{user}/.s3conf/s3config.yml",
|
32
|
+
:mode => 0644,
|
33
|
+
:owner => "#{user}:#{user}"}
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "install various s3 utils"
|
38
|
+
task :install do
|
39
|
+
gem2.install 's3sync'
|
40
|
+
deprec2.download_src(SRC_PACKAGES[:s3cmd], src_dir)
|
41
|
+
deprec2.install_from_src(SRC_PACKAGES[:s3cmd], src_dir)
|
42
|
+
end
|
43
|
+
|
44
|
+
desc <<-DESC
|
45
|
+
Generate s3utils config from template. Note that this does not
|
46
|
+
push the config to the server, it merely generates required
|
47
|
+
configuration files. These should be kept under source control.
|
48
|
+
The can be pushed to the server with the :config task.
|
49
|
+
DESC
|
50
|
+
task :config_gen do
|
51
|
+
s3utils_system_config_files.each do |file|
|
52
|
+
deprec2.render_template(:s3utils, file)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "Push s3utils config files to server"
|
57
|
+
task :config do
|
58
|
+
deprec2.push_configs(:s3utils, s3utils_system_config_files)
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Copyright 2006-2010 by Mike Bailey, le1t0@github. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :thinking_sphinx do
|
5
|
+
|
6
|
+
SRC_PACKAGES[:sphinx] = {
|
7
|
+
:filename => 'sphinx-0.9.9.tar.gz',
|
8
|
+
:dir => 'sphinx-0.9.9',
|
9
|
+
:url => "http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz",
|
10
|
+
:unpack => "tar zxf sphinx-0.9.9.tar.gz;",
|
11
|
+
:configure => %w(
|
12
|
+
./configure
|
13
|
+
;
|
14
|
+
).reject{|arg| arg.match '#'}.join(' '),
|
15
|
+
:make => 'make;',
|
16
|
+
:install => 'make install;'
|
17
|
+
}
|
18
|
+
|
19
|
+
desc "install Sphinx Search Engine"
|
20
|
+
task :install, :roles => :sphinx do
|
21
|
+
deprec2.download_src(SRC_PACKAGES[:sphinx], src_dir)
|
22
|
+
deprec2.install_from_src(SRC_PACKAGES[:sphinx], src_dir)
|
23
|
+
end
|
24
|
+
|
25
|
+
SYSTEM_CONFIG_FILES[:sphinx] = []
|
26
|
+
|
27
|
+
PROJECT_CONFIG_FILES[:sphinx] = [
|
28
|
+
|
29
|
+
{:template => 'monit.conf.erb',
|
30
|
+
:path => 'monit.conf',
|
31
|
+
:mode => 0644,
|
32
|
+
:owner => 'root:root'}
|
33
|
+
|
34
|
+
]
|
35
|
+
|
36
|
+
desc <<-DESC
|
37
|
+
Generate sphinx config from template. Note that this does not
|
38
|
+
push the config to the server, it merely generates required
|
39
|
+
configuration files. These should be kept under source control.
|
40
|
+
The can be pushed to the server with the :config task.
|
41
|
+
DESC
|
42
|
+
task :config_gen do
|
43
|
+
PROJECT_CONFIG_FILES[:sphinx].each do |file|
|
44
|
+
deprec2.render_template(:sphinx, file)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Push sphinx config files to server"
|
49
|
+
task :config, :roles => :sphinx do
|
50
|
+
config_project
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Push sphinx config files to server"
|
54
|
+
task :config_project, :roles => :sphinx do
|
55
|
+
deprec2.push_configs(:sphinx, PROJECT_CONFIG_FILES[:sphinx])
|
56
|
+
symlink_monit_config
|
57
|
+
end
|
58
|
+
|
59
|
+
task :symlink_monit_config, :roles => :sphinx do
|
60
|
+
sudo "ln -sf #{deploy_to}/sphinx/monit.conf #{monit_confd_dir}/sphinx_#{application}.conf"
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Init the sphinx searchd daemon (using Thinking Sphinx)"
|
64
|
+
task :init, :roles => :sphinx do
|
65
|
+
unless ENV['NO_SPHINX']
|
66
|
+
run "rm -f #{shared_path}/config/#{rails_env}.sphinx.conf"
|
67
|
+
run "rm -f #{current_path}/config/#{rails_env}.sphinx.conf"
|
68
|
+
run "ln -nsf #{shared_path}/config/#{rails_env}.sphinx.conf #{current_path}/config/"
|
69
|
+
run "sh -c 'cd #{current_path} ; rake ts:config RAILS_ENV=#{rails_env}'"
|
70
|
+
run "mkdir -p #{shared_path}/db/sphinx"
|
71
|
+
run "rm -rf #{current_path}/db/sphinx"
|
72
|
+
run "ln -nsf #{shared_path}/db/sphinx #{current_path}/db/"
|
73
|
+
run "sh -c 'cd #{current_path} ; rake ts:index RAILS_ENV=#{rails_env}'"
|
74
|
+
run "sh -c 'cd #{current_path} ; rake ts:start RAILS_ENV=#{rails_env}'"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "Start the sphinx searchd daemon (using Thinking Sphinx)"
|
79
|
+
task :start, :roles => :sphinx do
|
80
|
+
run "cd #{current_path} ; rake ts:restart RAILS_ENV=#{rails_env}"
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "Restart the sphinx searchd daemon (using Thinking Sphinx)"
|
84
|
+
task :restart, :roles => :sphinx do
|
85
|
+
run "cd #{current_path} ; rake ts:restart RAILS_ENV=#{rails_env}"
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "Stop the sphinx searchd daemon (using Thinking Sphinx)"
|
89
|
+
task :stop, :roles => :sphinx do
|
90
|
+
run "cd #{current_path} ; rake ts:stop RAILS_ENV=#{rails_env}"
|
91
|
+
end
|
92
|
+
|
93
|
+
desc "Index the sphinx searchd daemon (using Thinking Sphinx)"
|
94
|
+
task :reindex, :roles => :sphinx do
|
95
|
+
run "cd #{current_path} ; rake ts:index RAILS_ENV=#{rails_env}"
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "Configure the sphinx searchd daemon (using Thinking Sphinx)"
|
99
|
+
task :reconfig, :roles => [:app, :sphinx] do
|
100
|
+
run "cd #{current_path} ; bin/rake ts:config RAILS_ENV=#{rails_env} SPHINX_RAILS_ROOT=/apps/#{application}/current"
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# Copyright 2006-2008 by Mike Bailey. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :ultrasphinx do
|
5
|
+
|
6
|
+
SRC_PACKAGES[:sphinx] = {
|
7
|
+
:filename => 'sphinx-0.9.8-rc2.tar.gz',
|
8
|
+
:dir => 'sphinx-0.9.8-rc2',
|
9
|
+
:url => "http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc2.tar.gz",
|
10
|
+
:unpack => "tar zxf sphinx-0.9.8-rc2.tar.gz;",
|
11
|
+
:configure => %w(
|
12
|
+
./configure
|
13
|
+
;
|
14
|
+
).reject{|arg| arg.match '#'}.join(' '),
|
15
|
+
:make => 'make;',
|
16
|
+
:install => 'make install;'
|
17
|
+
}
|
18
|
+
|
19
|
+
desc "install Sphinx Search Engine"
|
20
|
+
task :install, :roles => :sphinx do
|
21
|
+
deprec2.download_src(SRC_PACKAGES[:sphinx], src_dir)
|
22
|
+
deprec2.install_from_src(SRC_PACKAGES[:sphinx], src_dir)
|
23
|
+
end
|
24
|
+
|
25
|
+
# install dependencies for sphinx
|
26
|
+
task :install_deps, :roles => :sphinx do
|
27
|
+
# apt.install( {:base => %w(blah)}, :stable )
|
28
|
+
end
|
29
|
+
|
30
|
+
SYSTEM_CONFIG_FILES[:sphinx] = []
|
31
|
+
|
32
|
+
PROJECT_CONFIG_FILES[:sphinx] = [
|
33
|
+
|
34
|
+
{:template => 'monit.conf.erb',
|
35
|
+
:path => 'monit.conf',
|
36
|
+
:mode => 0644,
|
37
|
+
:owner => 'root:root'}
|
38
|
+
|
39
|
+
]
|
40
|
+
|
41
|
+
desc <<-DESC
|
42
|
+
Generate sphinx config from template. Note that this does not
|
43
|
+
push the config to the server, it merely generates required
|
44
|
+
configuration files. These should be kept under source control.
|
45
|
+
The can be pushed to the server with the :config task.
|
46
|
+
DESC
|
47
|
+
task :config_gen do
|
48
|
+
PROJECT_CONFIG_FILES[:sphinx].each do |file|
|
49
|
+
deprec2.render_template(:sphinx, file)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Push sphinx config files to server"
|
54
|
+
task :config, :roles => :sphinx do
|
55
|
+
config_project
|
56
|
+
end
|
57
|
+
|
58
|
+
desc "Push sphinx config files to server"
|
59
|
+
task :config_project, :roles => :sphinx do
|
60
|
+
deprec2.push_configs(:sphinx, PROJECT_CONFIG_FILES[:sphinx])
|
61
|
+
symlink_monit_config
|
62
|
+
end
|
63
|
+
|
64
|
+
task :symlink_monit_config, :roles => :sphinx do
|
65
|
+
sudo "ln -sf #{deploy_to}/sphinx/monit.conf #{monit_confd_dir}/sphinx_#{application}.conf"
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
# Control
|
70
|
+
|
71
|
+
desc "Restart the sphinx searchd daemon"
|
72
|
+
task :restart, :roles => :app do
|
73
|
+
run("cd #{deploy_to}/current; /usr/bin/rake us:start") ### start or restart? SUDO ? ###
|
74
|
+
end
|
75
|
+
|
76
|
+
desc "Regenerate / Rotate the search index."
|
77
|
+
task :reindex, :roles => :app do
|
78
|
+
run("cd #{deploy_to}/current; /usr/bin/rake us:in") ### SUDO ? ###
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# ultrasphinx deployment notes
|
86
|
+
# http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/DEPLOYMENT_NOTES.html
|