mtncd 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile.lock +1 -1
  3. data/bin/mtncd +28 -21
  4. data/lib/mtncd/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzY3MDU1YWRhODYzZjA1M2UyZjZjYmRlY2IyOWEzZjZkOWY4ZDFmZA==
4
+ ODM3OGI1Y2NjMDgxODI3YmE1OGQ2YWZiMTc4ODQxYTMzOGFlY2U2NQ==
5
5
  data.tar.gz: !binary |-
6
- NjA2YjI1MjRiMDg0NjU0YWQ5NGExZmIxNGQyZjQzNGEwMGJmYmYzOA==
6
+ MDlkYzdmNGY0NjE3ODMzOTg3N2Y4NGE1YmU2YWUwYWMxMjdiNjIzNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDhhOWMwNWYxNzE3NzlkN2U5ZjFjYTQ4ODBlNDBkYTg1N2QzMDM1ZmUxMWQ5
10
- N2YxOWNjMjhmODIyZDk2OTAyZWMxNGU5ODUyMzE2YzBlODMyOWNmZGMyNjg4
11
- ZWExOTE3ZGMxMzg5OTVkYWQ5Y2FlMDY2NjhhOWE4ZmQzMTJkYTc=
9
+ NzFmODY3MWQwNjQyNjE3MGEwZmQxMGQ3MGEyYzgwMmVkNTk5N2NkOGUzODQ4
10
+ OTE5MzZmMTAyYzkxNWUxN2E5MGZlNjU0ZTQ1ZTdhNmExYWRhZWQwZjhiMTE2
11
+ OWJmZjQ3M2I0NTdhOWNjNWU4NTRlOGQyOWZkYzFlNjZjOTQ5YWY=
12
12
  data.tar.gz: !binary |-
13
- ZDg5MWQ4NGU4MTdhZGQ4MDE5ZmMyZDJiMDg4NTk0MTk1Y2Y2MDI0ZTVjZGJj
14
- OTRjMjQ0OTU1OGU4YTc5OTA0OGU4MzI0YWJiNzI4NzdmY2JjOWI0YTRhZjll
15
- NWYwZTM1ODQzM2JlZjM4ZTBiNzgxZDVlNTU4YTJjZDk1ZTFjMGM=
13
+ OTQ3NDNlMjk5NTA1ZjM4NGU5ZDIyOGJkMTcwZTI0OWMzNjU4MmE1MzVjZjNk
14
+ Nzg0MDM2OTgxODVjZjZiNDdjMzMxYjk5ZGJhMjgwOTMwYzgyMGZiNjEyY2Rj
15
+ ODA3ZDRmMWU5YzI2ZjE3N2E4ZTRiMjgyZDk3NmY5ZmI3MDU1YWI=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mtncd (0.0.3)
4
+ mtncd (0.0.4)
5
5
  awesome_print (= 1.2.0)
6
6
  gli (= 2.12.2)
7
7
  msgpack (= 0.5.9)
data/bin/mtncd CHANGED
@@ -29,9 +29,9 @@ command :deploy do |deploy|
29
29
  start.desc 'deploy starting with environment'
30
30
  start.default_value 'integration'
31
31
  start.flag :env, :must_match => {
32
- 'integration' => :integ,
33
- 'staging' => :stage,
34
- 'prod' => :prod
32
+ 'integ' => 'integration',
33
+ 'stage' => 'staging',
34
+ 'prod' => 'prod'
35
35
  }
36
36
 
37
37
  start.desc 'use deployment id'
@@ -41,8 +41,8 @@ command :deploy do |deploy|
41
41
  start.desc 'local or global cluster command'
42
42
  start.default_value 'global'
43
43
  start.flag :cluster, :must_match => {
44
- 'global' => :global,
45
- 'local' => :local
44
+ 'global' => 'global',
45
+ 'local' => 'local'
46
46
  }
47
47
 
48
48
  start.desc 'regex matching shipcodes to exclude from a deploy (overrides config file)'
@@ -56,12 +56,12 @@ command :deploy do |deploy|
56
56
  start.switch :single
57
57
 
58
58
  start.action do |global_options,options,args|
59
- if $config['role'] == 'sled' && options[:cluster] == :global
60
- raise "global commands are only available on central or infra nodes"
59
+ if $config['role'] == 'sled' && options[:cluster] == 'global'
60
+ raise 'global commands are only available on central or infra nodes'
61
61
  end
62
62
 
63
- if $config['role'] == 'central' && options[:cluster] == :local
64
- raise "local commands are only available on infra or sled nodes"
63
+ if $config['role'] == 'central' && options[:cluster] == 'local'
64
+ raise 'local commands are only available on infra or sled nodes'
65
65
  end
66
66
 
67
67
  event_options_hash = {
@@ -90,7 +90,7 @@ command :deploy do |deploy|
90
90
  end
91
91
  end
92
92
 
93
- deploy.desc "stops a deployment"
93
+ deploy.desc 'stops a deployment'
94
94
  deploy.command :stop do |stop|
95
95
  stop.desc 'use deployment id'
96
96
  stop.flag :id, :required => true
@@ -98,17 +98,17 @@ command :deploy do |deploy|
98
98
  stop.desc 'local or global cluster command'
99
99
  stop.default_value 'global'
100
100
  stop.flag :cluster, :must_match => {
101
- "global" => :global,
102
- "local" => :local
101
+ 'global' => 'global',
102
+ 'local' => 'local'
103
103
  }
104
104
 
105
105
  stop.action do |global_options,options,args|
106
- if $config['role'] == 'sled' && options[:cluster] == :global
107
- raise "global commands are only available on central or infra nodes"
106
+ if $config['role'] == 'sled' && options[:cluster] == 'global'
107
+ raise 'global commands are only available on central or infra nodes'
108
108
  end
109
109
 
110
- if $config['role'] == 'central' && options[:cluster] == :local
111
- raise "local commands are only available on infra or sled nodes"
110
+ if $config['role'] == 'central' && options[:cluster] == 'local'
111
+ raise 'local commands are only available on infra or sled nodes'
112
112
  end
113
113
 
114
114
  event_options_hash = {
@@ -147,16 +147,17 @@ command :status do |status|
147
147
  status.desc 'local or global cluster'
148
148
  status.default_value 'global'
149
149
  status.flag :cluster, :must_match => {
150
- 'global' => :global,
151
- 'local' => :local
150
+ 'global' => 'global',
151
+ 'local' => 'local'
152
152
  }
153
153
 
154
- status.action do |global_options,options,args|
155
- if $config['role'] == 'sled' && options[:cluster] == :global
154
+ status.action do |global_options,options,args|
155
+
156
+ if $config['role'] == 'sled' && options[:cluster] == 'global'
156
157
  raise "global status is only available on central or infra nodes"
157
158
  end
158
159
 
159
- if $config['role'] == 'central' && options[:cluster] == :local
160
+ if $config['role'] == 'central' && options[:cluster] == 'local'
160
161
  raise "local status is only available on infra or sled nodes"
161
162
  end
162
163
 
@@ -196,6 +197,12 @@ command :system do |system|
196
197
  # check resque
197
198
  begin
198
199
  Resque.redis = "#{$config['system']['redis']['ip']}:#{$config['system']['redis']['port']}"
200
+
201
+ # clean up any workers that didn't exit gracefuly.
202
+ Resque.workers.each { |worker|
203
+ worker.prune_dead_workers
204
+ }
205
+
199
206
  result = (Resque.workers.count == $config['system']['resque']['workers']) ? "OK" : "\033[31mFAIL\033[0m"
200
207
  success = Resque.workers.count == $config['system']['resque']['workers'] unless success == false
201
208
  puts "Resque - Should have #{$config['system']['resque']['workers']} workers, running #{Resque.workers.count} workers - [#{result}]"
@@ -1,3 +1,3 @@
1
1
  module Mtncd
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtncd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MTN Satellite Communications
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-17 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque