takeltau 0.45.6 → 0.45.9
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/lib/takeltau/default.yml +1 -0
- data/lib/takeltau/lib/system.rb +2 -3
- data/lib/takeltau/ship/container/lib.rb +12 -4
- data/lib/takeltau/ship/project/start.rb +13 -3
- data/lib/takeltau/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563c6169a25b3a9ec927e7a522985e857d16ada464053da7251f46cb2c13e83d
|
4
|
+
data.tar.gz: d8d7df3eafdb48fd85052b0fb473545e261d826c434f0c66ff20244588060cdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0f6529f6c94691b2b28daf0f5c5134a89eaff8130da3c230cad2350aa6044d070724bc8622839be60a515092f275fb6245819c5f8722ced4a9849edf4d6a1e
|
7
|
+
data.tar.gz: ffedfb934a6c3ab8035e9630aa1531c23c37929b8d746332ecc47fae17328757e12891307de7297cbbe55c87f0feaba9fb9274436a44d98c59108e80efc53f80
|
data/lib/takeltau/default.yml
CHANGED
data/lib/takeltau/lib/system.rb
CHANGED
@@ -172,7 +172,7 @@ module SystemModule
|
|
172
172
|
true
|
173
173
|
end
|
174
174
|
|
175
|
-
# Read
|
175
|
+
# Read file.
|
176
176
|
def _file_read(file)
|
177
177
|
begin
|
178
178
|
@content_file = File.read File.expand_path(file)
|
@@ -213,8 +213,7 @@ module SystemModule
|
|
213
213
|
begin
|
214
214
|
content = YAML.safe_load content_yaml
|
215
215
|
rescue Psych::SyntaxError
|
216
|
-
log.debug
|
217
|
-
log.debug "Try: yamllint #{file}"
|
216
|
+
log.debug 'Invalid YAML'
|
218
217
|
return false
|
219
218
|
end
|
220
219
|
content
|
@@ -6,8 +6,7 @@ module ShipContainerLib
|
|
6
6
|
|
7
7
|
# Run nonprivileged docker command
|
8
8
|
def _ship_container_lib_docker_nonprivileged(command, args = '')
|
9
|
-
|
10
|
-
args = "#{args} #{args_nonprivileged}" if config.active['ship_run_args_nonprivileged']
|
9
|
+
args = _ship_container_lib_ship_args args, config.active['ship_run_args_nonprivileged']
|
11
10
|
cmd_docker_run_command = format(
|
12
11
|
config.active['cmd_ship_project_start_docker_run_nonprivileged'],
|
13
12
|
ship_docker: config.active['cmd_ship_docker'],
|
@@ -23,8 +22,7 @@ module ShipContainerLib
|
|
23
22
|
def _ship_container_lib_docker_privileged(ports, command, args: '', ship_hostname_suffix: nil, publish_ports: true)
|
24
23
|
suffix = "_#{ship_hostname_suffix}" unless ship_hostname_suffix.nil?
|
25
24
|
ship_hostname = "#{_ship_container_lib_ship_hostname}#{suffix}"
|
26
|
-
|
27
|
-
args = "#{args} #{args_privileged}" if args_privileged
|
25
|
+
args = _ship_container_lib_ship_args args, config.active['ship_run_args_privileged']
|
28
26
|
ship_env = _ship_container_lib_ship_env ports
|
29
27
|
ports = _ship_container_lib_publish(ports, publish_ports)
|
30
28
|
ship_data_dir = config.active['ship_data_dir']
|
@@ -57,6 +55,16 @@ module ShipContainerLib
|
|
57
55
|
run_and_exit cmd_docker_run_command
|
58
56
|
end
|
59
57
|
|
58
|
+
# Return privileged args
|
59
|
+
def _ship_container_lib_ship_args(args, config_args)
|
60
|
+
args = "#{args} #{config_args}" if config_args
|
61
|
+
args_debug = '--env TAKELSHIP_DEBUG=true'
|
62
|
+
args = "#{args} #{args_debug}" if log.level == Logger::DEBUG
|
63
|
+
args_sync = '--env TAKELSHIP_IMAGES_SYNC=false'
|
64
|
+
args = "#{args} #{args_sync}" unless config.active['ship_images_sync']
|
65
|
+
args
|
66
|
+
end
|
67
|
+
|
60
68
|
# Return takelship image
|
61
69
|
def _ship_container_lib_image
|
62
70
|
ship_user = config.active['ship_user']
|
@@ -76,8 +76,15 @@ module ShipProjectStart
|
|
76
76
|
|
77
77
|
# print ports after starting a takelship
|
78
78
|
def _ship_project_start_print_ports(ports)
|
79
|
-
output = []
|
80
79
|
max_length = _ship_project_start_get_maxlength ports
|
80
|
+
ports_list = _ship_project_start_get_ports_list ports, max_length
|
81
|
+
ports_list.sort_by! { |port| port[:port] }
|
82
|
+
say ports_list.map { |port| port[:string] }.join("\n")
|
83
|
+
end
|
84
|
+
|
85
|
+
# get a sortable list of port numbers and strings describing the ports
|
86
|
+
def _ship_project_start_get_ports_list(ports, max_length)
|
87
|
+
ports_list = []
|
81
88
|
ports.each_value do |port|
|
82
89
|
next unless port['localhost'].to_i.between? 1, 65_535
|
83
90
|
|
@@ -85,9 +92,12 @@ module ShipProjectStart
|
|
85
92
|
service = "[#{port['service']} #{port['protocol']}]"
|
86
93
|
description = port['description']
|
87
94
|
description = " (#{description})" if port.key? 'description'
|
88
|
-
|
95
|
+
ports_list << {
|
96
|
+
port: port['localhost'].to_i,
|
97
|
+
string: "#{url.ljust(max_length['url'])} #{service.ljust(max_length['service'])}#{description}"
|
98
|
+
}
|
89
99
|
end
|
90
|
-
|
100
|
+
ports_list
|
91
101
|
end
|
92
102
|
|
93
103
|
# get max length of left column
|
data/lib/takeltau/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.45.
|
1
|
+
0.45.9
|