brightbox 0.24 → 0.25

Sign up to get free protection for your applications and to get access to all the features.
data/bin/brightbox-monit CHANGED
@@ -20,7 +20,7 @@ OptionParser.new do |opts|
20
20
  ) { |value| @railsroot = value }
21
21
  opts.on("-e", "--railsenv RAILS_ENV",
22
22
  "rails environment"
23
- ) { |value| @railsroot = value }
23
+ ) { |value| @railsenv = value }
24
24
  opts.on("-p", "--port MONGREL_PORT",
25
25
  "Port of the first mongrel sevuce"
26
26
  ) { |value| @port = value.to_i }
@@ -1,4 +1,5 @@
1
1
  require 'mongrel_cluster/recipes'
2
+ require 'yaml'
2
3
 
3
4
  Capistrano.configuration(:must_exist).load do
4
5
 
@@ -16,12 +17,12 @@ end
16
17
 
17
18
  desc "Load the rails db schema on the primary db server"
18
19
  task :load_schema, :roles => :db, :primary => true do
19
- run "cd #{current_path} && #{rake} RAILS_ENV=#{rails_env} db:schema:load"
20
+ run "cd #{current_path} && #{rake} RAILS_ENV=#{(rails_env||"production").to_s} db:schema:load"
20
21
  end
21
22
 
22
23
  desc "Configure monit to handle the mongrel servers for this app"
23
24
  task :configure_mongrel_cluster, :roles => :app do
24
- sudo "/usr/bin/brightbox-monit -n #{application} -r #{current_path} -p #{mongrel_port} -s #{mongrel_servers} -h #{mongrel_host}"
25
+ sudo "/usr/bin/brightbox-monit -n #{application} -r #{current_path} -e #{(rails_env||"production").to_s} -p #{mongrel_port} -s #{mongrel_servers} -h #{mongrel_host}"
25
26
  end
26
27
 
27
28
  desc "Restart the mongrel servers using monit"
@@ -104,11 +105,17 @@ end
104
105
 
105
106
  def read_db_config
106
107
  db_config = YAML.load_file('config/database.yml')
107
- set :db_adapter, db_config["production"]["adapter"]
108
- set :db_user, db_config["production"]["username"]
109
- set :db_password, db_config["production"]["password"]
110
- set :db_name, db_config["production"]["database"]
111
- set :db_host, db_config["production"]["host"]
108
+ set :db_adapter, db_config[(rails_env||"production").to_s]["adapter"]
109
+ set :db_user, db_config[(rails_env||"production").to_s]["username"]
110
+ set :db_password, db_config[(rails_env||"production").to_s]["password"]
111
+ set :db_name, db_config[(rails_env||"production").to_s]["database"]
112
+ set :db_host, db_config[(rails_env||"production").to_s]["host"]
113
+ if db_host !~ /^sqlreadwrite/
114
+ logger.important "WARNING: Database host is not sqlreadwrite as per the Brightbox requirements"
115
+ end
116
+ if db_name !~ /^#{db_user}\_/
117
+ logger.important "WARNING: Database name is not prefixed with MySQL username as per the Brightbox requirements"
118
+ end
112
119
  end
113
120
 
114
121
  end
metadata CHANGED
@@ -1,65 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: brightbox
5
3
  version: !ruby/object:Gem::Version
6
- version: "0.24"
7
- date: 2007-11-02 00:00:00 +00:00
8
- summary: Brightbox rails deployment scripts for Capistrano
9
- require_paths:
10
- - lib
11
- email: john@brightbox.co.uk
12
- homepage: http://rubyforge.org/projects/brightbox/
13
- rubyforge_project:
14
- description:
15
- autorequire: name
16
- default_executable: brightbox
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: "0.25"
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - John Leach
31
- files:
32
- - bin/brightbox-apache
33
- - bin/brightbox-monit
34
- - bin/brightbox
35
- - lib/brightbox
36
- - lib/brightbox/recipes.rb
37
- - lib/brightbox/generators
38
- - lib/brightbox/generators/loader.rb
39
- - lib/brightbox/generators/brightbox
40
- - lib/brightbox/generators/brightbox/brightboxapache_generator.rb
41
- - lib/brightbox/generators/brightbox/brightbox_generator.rb
42
- - lib/brightbox/generators/brightbox/templates
43
- - lib/brightbox/generators/brightbox/templates/deploy.rb
44
- test_files: []
45
-
46
- rdoc_options: []
47
-
48
- extra_rdoc_files: []
49
-
50
- executables:
51
- - brightbox
52
- - brightbox-apache
53
- - brightbox-monit
54
- extensions: []
55
-
56
- requirements: []
8
+ autorequire: name
9
+ bindir: bin
10
+ cert_chain: []
57
11
 
12
+ date: 2007-12-28 00:00:00 +00:00
13
+ default_executable: brightbox
58
14
  dependencies:
59
15
  - !ruby/object:Gem::Dependency
60
16
  name: capistrano
61
17
  version_requirement:
62
- version_requirements: !ruby/object:Gem::Version::Requirement
18
+ version_requirements: !ruby/object:Gem::Requirement
63
19
  requirements:
64
20
  - - ">="
65
21
  - !ruby/object:Gem::Version
@@ -71,9 +27,60 @@ dependencies:
71
27
  - !ruby/object:Gem::Dependency
72
28
  name: mongrel_cluster
73
29
  version_requirement:
74
- version_requirements: !ruby/object:Gem::Version::Requirement
30
+ version_requirements: !ruby/object:Gem::Requirement
75
31
  requirements:
76
32
  - - ">="
77
33
  - !ruby/object:Gem::Version
78
34
  version: 1.0.2
79
35
  version:
36
+ description:
37
+ email: john@brightbox.co.uk
38
+ executables:
39
+ - brightbox
40
+ - brightbox-apache
41
+ - brightbox-monit
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - bin/brightbox-apache
48
+ - bin/brightbox-monit
49
+ - bin/brightbox
50
+ - lib/brightbox
51
+ - lib/brightbox/recipes.rb
52
+ - lib/brightbox/generators
53
+ - lib/brightbox/generators/loader.rb
54
+ - lib/brightbox/generators/brightbox
55
+ - lib/brightbox/generators/brightbox/brightboxapache_generator.rb
56
+ - lib/brightbox/generators/brightbox/brightbox_generator.rb
57
+ - lib/brightbox/generators/brightbox/templates
58
+ - lib/brightbox/generators/brightbox/templates/deploy.rb
59
+ has_rdoc: false
60
+ homepage: http://rubyforge.org/projects/brightbox/
61
+ post_install_message:
62
+ rdoc_options: []
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ version:
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ version:
78
+ requirements: []
79
+
80
+ rubyforge_project:
81
+ rubygems_version: 0.9.5
82
+ signing_key:
83
+ specification_version: 2
84
+ summary: Brightbox rails deployment scripts for Capistrano
85
+ test_files: []
86
+