stacksondeck 1.0.8 → 1.0.9

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 +4 -4
  2. data/Readme.md +12 -6
  3. data/VERSION +1 -1
  4. data/lib/stacksondeck/app.rb +5 -11
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9069c2d40db7fd8dd0ec29a4cd6dd928ae1b8b22
4
- data.tar.gz: 6d6819368b69639482e86cad8b0776f4fde2e752
3
+ metadata.gz: 53c517b8de2a7bd8631be5f3cd12b35220e66769
4
+ data.tar.gz: fe3c814a53df6b881987179f02ef94327c223943
5
5
  SHA512:
6
- metadata.gz: f49f5d597deec88f9a21060b5f84a9516a29f61ad883624802f9f21890dbf814983057315ad8d1145cd81b899b47117dde51697f8db4567a8007fe7f2fe7fa8a
7
- data.tar.gz: bdec85e94c68f6cd46690dbebe94b4e12e8e9bd54849bdb57c71f9da3b3207a022dd3eaffbde34d6657b3d4358278813000a110ad4496138dd16ea9311352b29
6
+ metadata.gz: 10eeb5075a97f08c7a4f14bf637eafc9c8059777d96ac351be9922a091c93734b4451d8a1dc35da60a5ecda7b28c90ded958b7a4562ba42b6111d8972365b6d6
7
+ data.tar.gz: cff7f85363c09a41359a095ad17778401c7a6f7c418bb99d9109d3d0cbce7086e27602adad8956f14e9b3e66a2468566d2b87b3ee70a863d6595e0c4b1fe75a1
data/Readme.md CHANGED
@@ -49,16 +49,14 @@ You're most likely inteterested in the `server` command:
49
49
 
50
50
  Start application web server
51
51
 
52
+ **N.B.** At Blue Jeans we use the [`bjn_sod` cookbook](https://github.com/sczizzo/bjn-sod-cookbook)
53
+ to deploy Stacks on Deck.
52
54
 
53
55
  ## API
54
56
 
55
- ### Version `GET /v`
57
+ ### `GET /`
56
58
 
57
- Return the application version.
58
-
59
- ### Node Resources `GET /`
60
-
61
- Renders Chef nodes as a Rundeck Resource Model in YAML format. Sample response:
59
+ Renders Chef nodes as a Rundeck Resource Model in [RESOURCE-YAML](http://rundeck.org/docs/man5/resource-yaml.html):
62
60
 
63
61
  ---
64
62
  example-node:
@@ -75,6 +73,14 @@ Renders Chef nodes as a Rundeck Resource Model in YAML format. Sample response:
75
73
  - example-node
76
74
  - example
77
75
 
76
+ ### `GET /v`
77
+
78
+ Return the application version:
79
+
80
+ 1.0.0
81
+
82
+ (Yeah I lied when I said only one endpoint. Sue me.)
83
+
78
84
 
79
85
  ## Changelog
80
86
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9
@@ -14,14 +14,16 @@ module StacksOnDeck
14
14
  class App < Sinatra::Application
15
15
 
16
16
  def self.run!
17
- open!
18
17
  at_exit { close! }
18
+ open!
19
+
19
20
  Thread.new do
20
21
  loop do
21
22
  refresh!
22
23
  sleep settings.refresh
23
24
  end
24
25
  end
26
+
25
27
  super
26
28
  end
27
29
 
@@ -54,22 +56,16 @@ module StacksOnDeck
54
56
 
55
57
 
56
58
  def self.open!
57
- reopen!
58
59
  log.info event: 'open!', db: settings.database
60
+ @@db = Daybreak::DB.new settings.database
59
61
  @@db_dump = YAML.dump db_copy
60
62
  @@last_modified = Time.now
61
63
  end
62
64
 
63
65
 
64
- def self.reopen!
65
- old_db = @@db if defined? @@db
66
- @@db = Daybreak::DB.new settings.database
67
- old_db.close if old_db
68
- end
69
-
70
-
71
66
  def self.close!
72
67
  log.info event: 'close!', db: settings.database
68
+ @@db.flush
73
69
  @@db.close
74
70
  end
75
71
 
@@ -141,8 +137,6 @@ module StacksOnDeck
141
137
 
142
138
  rescue Celluloid::Task::TerminatedError
143
139
  # nop
144
- rescue
145
- reopen!
146
140
  end
147
141
 
148
142
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stacksondeck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-02 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor