ors 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,8 @@ module ORS::Commands
6
6
  info "deploying #{name} #{environment}..."
7
7
 
8
8
  [Update, Migrate, Restart].each {|command| run command }
9
+
10
+ eval ERB.new(deploy_hook).result(binding) if deploy_hook
9
11
  end
10
12
 
11
13
  end
@@ -5,8 +5,8 @@ module ORS::Commands
5
5
  def execute
6
6
  puts "ORS v#{ORS::VERSION} configuration:\n\n"
7
7
 
8
- [:name, :environment, :use_gateway, :pretending, :log_lines, :rails2, :gateway, :deploy_user,
9
- :repo, :base_path, :web_servers, :app_servers, :migration_server, :console_server, :cron_server].each do |config_variable|
8
+ [:name, :environment, :use_gateway, :pretending, :log_lines, :rails2, :gateway, :deploy_user, :repo,
9
+ :base_path, :deploy_hook, :web_servers, :app_servers, :migration_server, :console_server, :cron_server].each do |config_variable|
10
10
  puts "%20s: %-40s" % [config_variable, ORS::Config.send(config_variable).inspect]
11
11
  end
12
12
  end
@@ -5,12 +5,17 @@ module ORS::Commands
5
5
  def execute
6
6
  info "setting up #{name} #{environment}..."
7
7
 
8
- execute_in_parallel(all_servers) {|server| setup_repo server }
9
- execute_in_parallel(ruby_servers) {|server| setup_ruby server }
8
+ info "Are you sure? ('crashandburn' + ctrl+D^2)"
9
+ if STDIN.read == "crashandburn"
10
+ execute_in_parallel(all_servers) {|server| setup_repo server }
11
+ execute_in_parallel(ruby_servers) {|server| setup_ruby server }
10
12
 
11
- execute_command migration_server, %(source ~/.rvm/scripts/rvm),
12
- %(cd #{deploy_directory}),
13
- %(RAILS_ENV=#{environment} bundle exec rake db:create)
13
+ execute_command migration_server, %(source ~/.rvm/scripts/rvm),
14
+ %(cd #{deploy_directory}),
15
+ %(RAILS_ENV=#{environment} bundle exec rake db:create)
16
+ else
17
+ info "Stopping crash and burn setup"
18
+ end
14
19
  end
15
20
 
16
21
  end
data/lib/ors/config.rb CHANGED
@@ -3,7 +3,7 @@ module ORS
3
3
 
4
4
  CONFIG_FILENAME="config/deploy.yml"
5
5
 
6
- mattr_accessor :name, :environment, :use_gateway, :pretending, :log_lines, :rails2
6
+ mattr_accessor :name, :environment, :use_gateway, :pretending, :log_lines, :rails2, :deploy_hook
7
7
  mattr_accessor :gateway, :deploy_user, :repo, :base_path, :web_servers, :app_servers, :migration_server, :console_server, :cron_server
8
8
 
9
9
  self.environment = "production"
@@ -49,16 +49,16 @@ module ORS
49
49
  %w(production demo staging)
50
50
  end
51
51
 
52
+ def git
53
+ @git ||= Git.open(Dir.pwd)
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def name_from_git
55
59
  git.config["remote.origin.url"].gsub /.*?:(.*?).git/, '\1'
56
60
  end
57
61
 
58
- def git
59
- @git ||= Git.open(Dir.pwd)
60
- end
61
-
62
62
  end
63
63
  extend ModuleMethods
64
64
 
@@ -70,6 +70,10 @@ module ORS
70
70
  (web_servers + ruby_servers).uniq
71
71
  end
72
72
 
73
+ def revision
74
+ Config.git.log(1).first.sha
75
+ end
76
+
73
77
  def deploy_directory
74
78
  directory = File.join base_path, name
75
79
 
data/lib/ors/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ORS
2
- VERSION = "0.1.8"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/ors.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "rubygems"
2
2
  require "git"
3
3
  require "yaml"
4
+ require "erb"
4
5
 
5
6
  require "ors/version"
6
7
  require "ors/core_ext"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ors
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 8
10
- version: 0.1.8
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jason Dew and John Long
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-06 00:00:00 -04:00
18
+ date: 2011-04-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements: []
142
142
 
143
143
  rubyforge_project: ors
144
- rubygems_version: 1.4.2
144
+ rubygems_version: 1.4.1
145
145
  signing_key:
146
146
  specification_version: 3
147
147
  summary: Heroku-like deployment utilities for ORS