config_skeleton 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49838a344a63bcd0b3f308dbdc58f4d8a7426733e95c09feb72e5c8fb9fd4a99
4
- data.tar.gz: 89b2e5c74c73131522ca2a062ed66c1d74fe4f74acfa41b3af6e5b5daa0ef6dc
3
+ metadata.gz: 3decded320f1627ee52256496c4f2f0ced9cc787b38ca7c5065d0e9ccea7a906
4
+ data.tar.gz: 6eeba5f6a38a171599a8c85d35ab0165c7db4f2b4a2ab2e078a1d23abf9c8f1c
5
5
  SHA512:
6
- metadata.gz: d16025a92349c9e413754ff60afbe8e9147a4806ddd73cbe9f8425f2c781bde749b492de996c0eb919836ac6fc6c4e133a82de5c082929a22cb5405d2dccf9a4
7
- data.tar.gz: a97c7c2713196ffd8720c5734f8b08a850410811e2afc957f098c56e5156040cf091a173c2bc868a4f7be452307887dbbf7f84533aed1975cb77810423285a6a
6
+ metadata.gz: b1e51aa4cff67245811b0b9d225387fb0935003382be8680c9106efb17ab6949a5ea4733dad63a071c2bb31912b1e2bb0061723b058aab3bdefb975ec631b565
7
+ data.tar.gz: 9278ad654c21331efa446f8d7212af9717778b1b4ea3efdf71ce30ad484a0fc948ebf7f114c2308b0e5f1036f669f0abab6ba81d1323400d025898fc0310cf38
data/README.md CHANGED
@@ -24,6 +24,9 @@ presumably know what to do already.
24
24
 
25
25
  # Usage
26
26
 
27
+ A single execution of configuration generation can be performed by specifying
28
+ the `SERVICE_NAME_CONFIG_ONESHOT=true` environment variable.
29
+
27
30
  All of the documentation is provided in the [ConfigSkeleton class](https://rubydoc.info/gems/config_skeleton/ConfigSkeleton).
28
31
 
29
32
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "config_skeleton"
5
- s.version = "2.2.1"
5
+ s.version = "2.3.0"
6
6
 
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = "Dynamically generate configs and reload servers"
@@ -145,6 +145,7 @@ end
145
145
  #
146
146
  class ConfigSkeleton
147
147
  include ServiceSkeleton
148
+
148
149
  # All ConfigSkeleton-related errors will be subclasses of this.
149
150
  class Error < StandardError; end
150
151
 
@@ -164,6 +165,8 @@ class ConfigSkeleton
164
165
  end
165
166
 
166
167
  def self.inherited(klass)
168
+ klass.boolean "#{klass.service_name.upcase}_CONFIG_ONESHOT".to_sym, default: false
169
+
167
170
  klass.gauge :"#{klass.service_name}_config_ok", docstring: "Whether the last config change was accepted by the server"
168
171
  klass.gauge :"#{klass.service_name}_generation_ok", docstring: "Whether the last config generation completed without error"
169
172
  klass.gauge :"#{klass.service_name}_last_generation_timestamp", docstring: "When the last config generation run was made"
@@ -242,6 +245,11 @@ class ConfigSkeleton
242
245
 
243
246
  write_initial_config
244
247
 
248
+ if config.config_oneshot
249
+ logger.info(logloc) { "Oneshot run specified - exiting" }
250
+ Process.kill("TERM", $PID)
251
+ end
252
+
245
253
  watch(*self.class.watches)
246
254
 
247
255
  logger.debug(logloc) { "notifier fd is #{notifier.to_io.inspect}" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_skeleton
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-17 00:00:00.000000000 Z
12
+ date: 2023-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diffy