envirobly-orchestra 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/orchestra/base.rb +6 -2
- data/lib/orchestra/cli/services.rb +5 -1
- data/lib/orchestra/logger.rb +1 -0
- data/lib/orchestra/version.rb +1 -1
- data/lib/orchestra.rb +2 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a146603656b0f7d989daba62fac148bed321781ad26c5a822da7ec1b75bcc18
|
4
|
+
data.tar.gz: 7c8d3a88177da3422c850bc371c821ced7704413bcfcc5d3b475d7c812939083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdfee431c6e723f79c5cfb647104f974cb12ca40b1975bfe1b1c1a43528cf51f84cf7dc110b1bd9549c520cd93f79210be674484787a5b9077bf9b21c407fb72
|
7
|
+
data.tar.gz: d16acac39984a4d0d15dd2de18cf0460c7b1b4973449774a904c87ed521fa89062bd36995b276b532f20bed69148720ee7e95e03ce43d9380896dc09341b77d0
|
data/lib/orchestra/base.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "thor"
|
2
|
+
require "logger"
|
2
3
|
|
3
4
|
class Orchestra::Base < Thor
|
4
5
|
def self.exit_on_failure?
|
@@ -27,13 +28,16 @@ class Orchestra::Base < Thor
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def log(text)
|
30
|
-
|
31
|
+
# Size-based rotated logging: 3 10-megabyte files.
|
32
|
+
@logger ||= Logger.new("/var/log/orchestra.log", 3, 10485760)
|
33
|
+
|
34
|
+
@logger.info text
|
31
35
|
end
|
32
36
|
|
33
37
|
def execute(cmd, exit_on_failure: true)
|
34
38
|
stdout_and_err, status = Open3.capture2e *cmd
|
35
39
|
|
36
|
-
log stdout_and_err unless stdout_and_err.
|
40
|
+
log stdout_and_err unless stdout_and_err.nil? || stdout_and_err.empty?
|
37
41
|
|
38
42
|
if exit_on_failure && status.to_i > 0
|
39
43
|
exit 1
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require "open3"
|
2
2
|
# require "httpx"
|
3
3
|
require "pathname"
|
4
|
+
require "yaml"
|
5
|
+
require "erb"
|
4
6
|
|
5
7
|
class Orchestra::Cli::Services < Orchestra::Base
|
6
8
|
desc "up", "Start services based on config synced from config bucket"
|
@@ -99,7 +101,7 @@ class Orchestra::Cli::Services < Orchestra::Base
|
|
99
101
|
|
100
102
|
def initialize_data_volumes
|
101
103
|
compose_definition["services"].each do |_, service|
|
102
|
-
next
|
104
|
+
next unless service["labels"]
|
103
105
|
|
104
106
|
zpool = service["labels"]["envirobly.data-volume.pool"]
|
105
107
|
mountpoint = service["labels"]["envirobly.data-volume.pool.mountpoint"]
|
@@ -107,6 +109,8 @@ class Orchestra::Cli::Services < Orchestra::Base
|
|
107
109
|
dataset_mountpoint = service["labels"]["envirobly.data-volume.dataset.mountpoint"]
|
108
110
|
device = service["labels"]["envirobly.data-volume.device"]
|
109
111
|
|
112
|
+
next if zpool.nil? || mountpoint.nil? || zfs_dataset.nil? || dataset_mountpoint.nil? || device.nil?
|
113
|
+
|
110
114
|
if zfs_dataset_exist?(zfs_dataset)
|
111
115
|
log " ZFS dataset exists"
|
112
116
|
next
|
data/lib/orchestra/logger.rb
CHANGED
data/lib/orchestra/version.rb
CHANGED
data/lib/orchestra.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envirobly-orchestra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Starsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activesupport
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '7.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '7.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: thor
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|