deprec 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,22 @@
1
1
  == git
2
2
 
3
+
4
+ == 2.0.1 (February 20, 2009)
5
+
6
+ Newly created ~/.caprc does not load Rails recipes.
7
+
8
+ This solves the problem of Capistrano's default deploy tasks
9
+ having 'before' and 'after' tasks added when you're deploying
10
+ a project that isn't setup to use deprec.
11
+
12
+ Existing users can update their existing ~/.caprc, replacing:
13
+
14
+ require 'deprec'
15
+
16
+ with:
17
+
18
+ require 'deprec_minus_rails'
19
+
3
20
  == 2.0.0 (February 14, 2009)
4
21
 
5
22
  * Official deprec-2.0 Rubyforge release!
data/bin/depify CHANGED
@@ -43,10 +43,15 @@ caprc = unindent(<<-FILE)
43
43
  # into Capfile or deploy.rb for those projects
44
44
  #
45
45
  # Uncomment any of the following entries to enable them.
46
- #
46
+
47
47
  # Include deprec - deployment recipes for Capistrano (www.deprec.org)
48
48
  #
49
- require 'deprec'
49
+ # This loads all recipes minus the ones in rails.rb
50
+ # The recipes in rails.rb add 'before' and 'after' tasks to
51
+ # some of the builtin cap deploy tasks which are not appropriate
52
+ # for deploying a project that isn't setup to use deprec.
53
+ #
54
+ require 'deprec_minus_rails'
50
55
 
51
56
  FILE
52
57
 
@@ -69,10 +74,10 @@ files = {
69
74
  # your SCM below:
70
75
  set :scm, :git
71
76
 
72
- set :ruby_vm_type, :ree
73
- set :web_server_type, :apache
74
- set :app_server_type, :passenger
75
- set :db_server_type, :mysql
77
+ set :ruby_vm_type, :ree # :ree, :mri
78
+ set :web_server_type, :apache # :apache, :nginx
79
+ set :app_server_type, :passenger # :passenger, :mongrel
80
+ set :db_server_type, :mysql # :mysql, :postgresql, :sqlite
76
81
 
77
82
  # set :packages_for_project, %w(libmagick9-dev imagemagick libfreeimage3) # list of packages to be installed
78
83
  # set :gems_for_project, %w(rmagick mini_magick image_science) # list of gems to be installed
@@ -47,6 +47,14 @@ Capistrano::Configuration.instance(:must_exist).load do
47
47
  namespace :deprec do
48
48
  namespace :rails do
49
49
 
50
+ #
51
+ # If database.yml is not kept in scm and it is present in local
52
+ # config dir then push it out to server.
53
+ #
54
+ before 'deprec:rails:symlink_database_yml', :roles => :app do
55
+ push_database_yml unless database_yml_in_scm
56
+ end
57
+
50
58
  task :setup_database, :roles => :db do
51
59
  if ! roles[:db].servers.empty? # Some apps don't use database!
52
60
  deprec2.read_database_yml
@@ -80,13 +88,13 @@ Capistrano::Configuration.instance(:must_exist).load do
80
88
  DESC
81
89
  task :install_stack do
82
90
 
83
- top.deprec.ruby.install
84
- top.deprec.web.install # Uses value of web_server_type
91
+ top.deprec.ruby.install
92
+ top.deprec.rails.install
85
93
  top.deprec.svn.install
86
94
  top.deprec.git.install
95
+ top.deprec.web.install # Uses value of web_server_type
87
96
  top.deprec.app.install # Uses value of app_server_type
88
97
  top.deprec.monit.install
89
- top.deprec.rails.install
90
98
  top.deprec.logrotate.install
91
99
 
92
100
  # We not longer install database server as part of this task.
@@ -199,6 +207,7 @@ Capistrano::Configuration.instance(:must_exist).load do
199
207
  if path != '.'
200
208
  deprec2.mkdir("#{current_path}/#{path}")
201
209
  end
210
+ sudo "test -d #{current_path}/#{dir} && mv #{current_path}/#{dir} #{current_path}/#{dir}.moved_by_deprec; exit 0"
202
211
  run "ln -nfs #{shared_path}/#{dir} #{current_path}/#{dir}"
203
212
  end
204
213
  end
@@ -273,6 +282,13 @@ Capistrano::Configuration.instance(:must_exist).load do
273
282
  run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
274
283
  end
275
284
 
285
+ desc "Copy database.yml to shared/config/database.yml. Useful if not kept in scm"
286
+ task :push_database_yml, :roles => :app do
287
+ if File.exists?('config/database.yml')
288
+ put(File.read('config/database.yml'), "#{shared_path}/config/database.yml")
289
+ end
290
+ end
291
+
276
292
  end
277
293
 
278
294
  namespace :database do
@@ -44,9 +44,10 @@ Capistrano::Configuration.instance(:must_exist).load do
44
44
  deprec2.push_configs(:ssl, PROJECT_CONFIG_FILES[:ssl])
45
45
  end
46
46
 
47
- task :generate_snakeoil_cert, :roles => :web do
48
- sudo "/usr/sbin/make-ssl-cert generate-default-snakeoil"
49
- end
47
+ # WOn't run without controlling terminal! :-(
48
+ # task :generate_snakeoil_cert, :roles => :web do
49
+ # sudo "/usr/sbin/make-ssl-cert generate-default-snakeoil"
50
+ # end
50
51
 
51
52
  end
52
53
 
@@ -55,11 +55,23 @@ Capistrano::Configuration.instance(:must_exist).load do
55
55
  # In the meantime we'll just use the snakeoil cert
56
56
  #
57
57
  # top.deprec.ssl.config_gen if apache_ssl_enabled
58
- top.deprec.ssl.generate_snakeoil_cert if apache_ssl_enabled
58
+ top.deprec.ssl.config_gen if apache_ssl_enabled
59
59
  end
60
60
 
61
61
  desc "Push apache config files to server"
62
62
  task :config, :roles => :web do
63
+ config_system
64
+ end
65
+
66
+ desc "Generate initial configs and copy direct to server."
67
+ task :initial_config, :roles => :web do
68
+ SYSTEM_CONFIG_FILES[:apache].each do |file|
69
+ deprec2.render_template(:apache, file.merge(:remote => true))
70
+ end
71
+ end
72
+
73
+ desc "Push apache config files to server"
74
+ task :config_system, :roles => :web do
63
75
  deprec2.push_configs(:apache, SYSTEM_CONFIG_FILES[:apache])
64
76
  end
65
77
 
@@ -68,7 +80,7 @@ Capistrano::Configuration.instance(:must_exist).load do
68
80
  # XXX Need to flesh out generation of custom certs
69
81
  # In the meantime we'll just use the snakeoil cert
70
82
  #
71
- # top.deprec.ssl.config if apache_ssl_enabled
83
+ top.deprec.ssl.config if apache_ssl_enabled
72
84
  end
73
85
 
74
86
  task :enable_modules, :roles => :web do
@@ -0,0 +1,62 @@
1
+ # Copyright 2006-2008 by Mike Bailey. All rights reserved.
2
+ unless Capistrano::Configuration.respond_to?(:instance)
3
+ abort "deprec2 requires Capistrano 2"
4
+ end
5
+
6
+ # Don't load the rails recipes in ~/.caprc
7
+ #
8
+ # This excludes the 'before' and 'after' tasks deprec adds to
9
+ # facilitate rails setup.
10
+ #
11
+ #require "#{File.dirname(__FILE__)}/recipes/rails"
12
+
13
+ require "#{File.dirname(__FILE__)}/recipes/canonical"
14
+ require "#{File.dirname(__FILE__)}/recipes/deprec"
15
+ require "#{File.dirname(__FILE__)}/recipes/deprecated"
16
+
17
+ require "#{File.dirname(__FILE__)}/recipes/app/mongrel"
18
+ require "#{File.dirname(__FILE__)}/recipes/app/passenger"
19
+ require "#{File.dirname(__FILE__)}/recipes/db/mysql"
20
+ require "#{File.dirname(__FILE__)}/recipes/db/postgresql"
21
+ require "#{File.dirname(__FILE__)}/recipes/db/sqlite"
22
+ require "#{File.dirname(__FILE__)}/recipes/ruby/mri"
23
+ require "#{File.dirname(__FILE__)}/recipes/ruby/ree"
24
+ require "#{File.dirname(__FILE__)}/recipes/web/apache"
25
+ require "#{File.dirname(__FILE__)}/recipes/web/nginx"
26
+
27
+ require "#{File.dirname(__FILE__)}/recipes/git"
28
+ require "#{File.dirname(__FILE__)}/recipes/gitosis"
29
+ require "#{File.dirname(__FILE__)}/recipes/svn"
30
+
31
+ require "#{File.dirname(__FILE__)}/recipes/users"
32
+ require "#{File.dirname(__FILE__)}/recipes/ssh"
33
+ require "#{File.dirname(__FILE__)}/recipes/php"
34
+ # require "#{File.dirname(__FILE__)}/recipes/scm/trac"
35
+
36
+ require "#{File.dirname(__FILE__)}/recipes/aoe"
37
+
38
+ require "#{File.dirname(__FILE__)}/recipes/xen"
39
+ require "#{File.dirname(__FILE__)}/recipes/xentools"
40
+
41
+ require "#{File.dirname(__FILE__)}/recipes/ddclient"
42
+ require "#{File.dirname(__FILE__)}/recipes/ntp"
43
+ require "#{File.dirname(__FILE__)}/recipes/logrotate"
44
+ require "#{File.dirname(__FILE__)}/recipes/ssl"
45
+
46
+ require "#{File.dirname(__FILE__)}/recipes/postfix"
47
+ require "#{File.dirname(__FILE__)}/recipes/memcache"
48
+ require "#{File.dirname(__FILE__)}/recipes/monit"
49
+ require "#{File.dirname(__FILE__)}/recipes/network"
50
+ require "#{File.dirname(__FILE__)}/recipes/nagios"
51
+ require "#{File.dirname(__FILE__)}/recipes/heartbeat"
52
+
53
+ require "#{File.dirname(__FILE__)}/recipes/ubuntu"
54
+ require "#{File.dirname(__FILE__)}/recipes/lvm"
55
+ require "#{File.dirname(__FILE__)}/recipes/vnstat"
56
+ require "#{File.dirname(__FILE__)}/recipes/sphinx"
57
+ require "#{File.dirname(__FILE__)}/recipes/utils"
58
+ require "#{File.dirname(__FILE__)}/recipes/apt_mirror"
59
+ # require "#{File.dirname(__FILE__)}/recipes/wordpress" Not working
60
+ require "#{File.dirname(__FILE__)}/recipes/wpmu"
61
+ require "#{File.dirname(__FILE__)}/recipes/ar_sendmail"
62
+ require "#{File.dirname(__FILE__)}/recipes/starling"
@@ -0,0 +1,12 @@
1
+ unless Capistrano::Configuration.respond_to?(:instance)
2
+ abort "deprec2 requires Capistrano 2"
3
+ end
4
+
5
+ require "#{File.dirname(__FILE__)}/deprec/capistrano_extensions"
6
+ require "#{File.dirname(__FILE__)}/vmbuilder_plugins/all"
7
+
8
+ # Don't load the rails recipes in ~/.caprc
9
+ #
10
+ # This excludes the 'before' and 'after' tasks deprec adds to
11
+ # facilitate rails setup.
12
+ require "#{File.dirname(__FILE__)}/deprec/recipes_minus_rails"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bailey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-13 00:00:00 +11:00
12
+ date: 2009-02-20 00:00:00 +11:00
13
13
  default_executable: depify
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -98,6 +98,7 @@ files:
98
98
  - lib/deprec/recipes/xen.rb
99
99
  - lib/deprec/recipes/xentools.rb
100
100
  - lib/deprec/recipes.rb
101
+ - lib/deprec/recipes_minus_rails.rb
101
102
  - lib/deprec/templates
102
103
  - lib/deprec/templates/aoe
103
104
  - lib/deprec/templates/aoe/aoe-init
@@ -222,6 +223,7 @@ files:
222
223
  - lib/deprec/templates/xentools/xm.tmpl.erb
223
224
  - lib/deprec.rb
224
225
  - lib/deprec_cmd_completion.sh
226
+ - lib/deprec_minus_rails.rb
225
227
  - lib/vmbuilder_plugins
226
228
  - lib/vmbuilder_plugins/all.rb
227
229
  - lib/vmbuilder_plugins/apt.rb