ors 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -48,25 +48,5 @@ Gemfile
48
48
 
49
49
  === Usage
50
50
 
51
+ run `ors help`
51
52
 
52
- Usage: ./ors <action> [environment=production] [options]
53
-
54
- === Actions
55
- help You're looking at it
56
- console Bring up a console on the production servers
57
- logs Show the last few log entries from the production servers
58
- deploy Update the code, run the migrations, and restart unicorn
59
- setup Sets up the default environment on the servers
60
- update Updates the code on all servers
61
- migrate Runs the migrations on the migration server
62
- start Starts up unicorn on the app servers
63
- stop Stops unicorn on the app servers
64
- restart Retarts unicorn on the app servers
65
-
66
- === Environments
67
- Must be one of: production demo staging
68
- Defaults to production.
69
-
70
- === Options
71
- --pretend (or -p) Don't execute anything, just show me what you're going to do (default: false)
72
- --no-gateway (or -ng) Don't use a gateway (if you're inside the firewall) (default: true)
data/lib/ors.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "rubygems"
2
2
  require "git"
3
+ require "yaml"
3
4
 
4
5
  require "ors/core_ext"
5
6
  require "ors/log_unifier"
data/lib/ors/command.rb CHANGED
@@ -15,6 +15,7 @@ module ORS
15
15
 
16
16
  if available_commands.include? klass
17
17
  ORS::Config.parse_options options
18
+ ORS::Config.parse_config_file
18
19
 
19
20
  if ORS::Config.valid_options?
20
21
  Base.run ORS::Commands.const_get(klass)
@@ -0,0 +1,16 @@
1
+ module ORS::Commands
2
+
3
+ class Env < Base
4
+
5
+ def execute
6
+ puts "ORS Config"
7
+ puts "=" * 80
8
+
9
+ [:name, :environment, :use_gateway, :pretending, :log_lines, :rails2, :gateway, :deploy_user,
10
+ :repo, :base_path, :web_servers, :app_servers, :migration_server, :console_server].each do |config_variable|
11
+ puts "#{config_variable}: #{ORS::Config.send(config_variable)}"
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -8,6 +8,7 @@ Usage: ./ors <action> [environment=production] [options]
8
8
 
9
9
  === Actions
10
10
  help You're looking at it
11
+ env Print out the configuration
11
12
  console Bring up a console on the production servers
12
13
  logs Show the last few log entries from the production servers
13
14
  exec Executes a command (via the CMD environment variable) on the migration server
data/lib/ors/config.rb CHANGED
@@ -1,7 +1,10 @@
1
1
  module ORS
2
2
  module Config
3
3
 
4
+ CONFIG_FILENAME="config/deploy.yml"
5
+
4
6
  mattr_accessor :name, :environment, :use_gateway, :pretending, :log_lines, :rails2
7
+ mattr_accessor :gateway, :deploy_user, :repo, :base_path, :web_servers, :app_servers, :migration_server, :console_server
5
8
 
6
9
  self.environment = "production"
7
10
  self.pretending = false
@@ -22,6 +25,21 @@ module ORS
22
25
  end
23
26
  end
24
27
 
28
+ def parse_config_file
29
+ if File.exists?(CONFIG_FILENAME)
30
+ YAML.load(File.read(CONFIG_FILENAME)).each {|(name, value)| send "#{name}=", value }
31
+ else
32
+ self.gateway = "deploy-gateway"
33
+ self.deploy_user = "deployer"
34
+ self.repo = "ors_git"
35
+ self.base_path = "/var/www"
36
+ self.web_servers = %w(koala)
37
+ self.app_servers = %w(eel jellyfish squid)
38
+ self.migration_server = "tuna"
39
+ self.console_server = "tuna"
40
+ end
41
+ end
42
+
25
43
  def valid_options?
26
44
  name.to_s.size > 0 and valid_environments.include?(environment)
27
45
  end
@@ -43,44 +61,12 @@ module ORS
43
61
  end
44
62
  extend ModuleMethods
45
63
 
46
- def gateway
47
- "deploy-gateway"
48
- end
49
-
50
- def deploy_user
51
- "deployer"
52
- end
53
-
54
- def repo
55
- "ors_git"
56
- end
57
-
58
- def base_path
59
- "/var/www"
60
- end
61
-
62
- def web_servers
63
- %w(koala)
64
- end
65
-
66
- def app_servers
67
- %w(eel jellyfish squid)
68
- end
69
-
70
- def migration_server
71
- "tuna"
72
- end
73
-
74
- def console_server
75
- "tuna"
76
- end
77
-
78
64
  def ruby_servers
79
- app_servers + [migration_server]
65
+ (app_servers + [migration_server]).uniq
80
66
  end
81
67
 
82
68
  def all_servers
83
- web_servers + app_servers + [migration_server]
69
+ (web_servers + app_servers + [migration_server]).uniq
84
70
  end
85
71
 
86
72
  def deploy_directory
data/lib/ors/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ORS
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,58 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ors
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.9
5
- prerelease: !!null
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jason Dew and John Long
9
- autorequire: !!null
14
+ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-02-09 00:00:00.000000000 -05:00
13
- default_executable: !!null
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-02-25 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: git
17
- requirement: &2168589680 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: '0'
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
23
33
  type: :runtime
24
- prerelease: false
25
- version_requirements: *2168589680
26
- - !ruby/object:Gem::Dependency
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
27
36
  name: rspec
28
- requirement: &2168589260 !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
29
39
  none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
34
47
  type: :development
35
- prerelease: false
36
- version_requirements: *2168589260
37
- - !ruby/object:Gem::Dependency
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
38
50
  name: rr
39
- requirement: &2168588840 !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
40
53
  none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '0'
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
45
61
  type: :development
46
- prerelease: false
47
- version_requirements: *2168588840
62
+ version_requirements: *id003
48
63
  description: Heroku-like deployment utilities for ORS
49
- email:
64
+ email:
50
65
  - jason.dew@ors.sc.gov and john.long@ors.sc.gov
51
- executables:
66
+ executables:
52
67
  - ors
53
68
  extensions: []
69
+
54
70
  extra_rdoc_files: []
55
- files:
71
+
72
+ files:
56
73
  - .autotest
57
74
  - .gitignore
58
75
  - .rspec
@@ -65,6 +82,7 @@ files:
65
82
  - lib/ors/commands/base.rb
66
83
  - lib/ors/commands/console.rb
67
84
  - lib/ors/commands/deploy.rb
85
+ - lib/ors/commands/env.rb
68
86
  - lib/ors/commands/exec.rb
69
87
  - lib/ors/commands/help.rb
70
88
  - lib/ors/commands/logs.rb
@@ -91,31 +109,40 @@ files:
91
109
  - spec/ors/log_unifier_spec.rb
92
110
  - spec/spec_helper.rb
93
111
  has_rdoc: true
94
- homepage: ''
112
+ homepage: ""
95
113
  licenses: []
96
- post_install_message: !!null
114
+
115
+ post_install_message:
97
116
  rdoc_options: []
98
- require_paths:
117
+
118
+ require_paths:
99
119
  - lib
100
- required_ruby_version: !ruby/object:Gem::Requirement
120
+ required_ruby_version: !ruby/object:Gem::Requirement
101
121
  none: false
102
- requirements:
103
- - - ! '>='
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ hash: 3
126
+ segments:
127
+ - 0
128
+ version: "0"
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
130
  none: false
108
- requirements:
109
- - - ! '>='
110
- - !ruby/object:Gem::Version
111
- version: '0'
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 0
137
+ version: "0"
112
138
  requirements: []
139
+
113
140
  rubyforge_project: ors
114
- rubygems_version: 1.5.0
115
- signing_key: !!null
141
+ rubygems_version: 1.4.1
142
+ signing_key:
116
143
  specification_version: 3
117
144
  summary: Heroku-like deployment utilities for ORS
118
- test_files:
145
+ test_files:
119
146
  - spec/ors/command_spec.rb
120
147
  - spec/ors/commands/base_spec.rb
121
148
  - spec/ors/commands/console_spec.rb