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 +4 -4
- data/README.md +3 -0
- data/config_skeleton.gemspec +1 -1
- data/lib/config_skeleton.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3decded320f1627ee52256496c4f2f0ced9cc787b38ca7c5065d0e9ccea7a906
|
4
|
+
data.tar.gz: 6eeba5f6a38a171599a8c85d35ab0165c7db4f2b4a2ab2e078a1d23abf9c8f1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/config_skeleton.gemspec
CHANGED
data/lib/config_skeleton.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diffy
|