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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31fce71fd0ba4d101ed66b23703b7c4dc8877bcb45beb52bc632c576ad9976af
4
- data.tar.gz: 72a1ab91250660ddb24b8899edb50c73bfe06c06403fdb24fe4be1d42c4f0e18
3
+ metadata.gz: 563c6169a25b3a9ec927e7a522985e857d16ada464053da7251f46cb2c13e83d
4
+ data.tar.gz: d8d7df3eafdb48fd85052b0fb473545e261d826c434f0c66ff20244588060cdc
5
5
  SHA512:
6
- metadata.gz: eb9a22c1e05fd55f9d57719595f854783b693d065a922dab8f07f22eeacf334ce6483c4ff2791387a9238cb489cc5d52a350846b3270da87597ee1cf49acc3f2
7
- data.tar.gz: 6a03a31c3ea73374798e6f10a7e84a1fe3f988770f91ef210b726ac6eafebd65dac978fa88d6e350fa15ec3a238a98d4bdcaa695c6a9403dc90a538610bb6596
6
+ metadata.gz: dd0f6529f6c94691b2b28daf0f5c5134a89eaff8130da3c230cad2350aa6044d070724bc8622839be60a515092f275fb6245819c5f8722ced4a9849edf4d6a1e
7
+ data.tar.gz: ffedfb934a6c3ab8035e9630aa1531c23c37929b8d746332ecc47fae17328757e12891307de7297cbbe55c87f0feaba9fb9274436a44d98c59108e80efc53f80
@@ -94,6 +94,7 @@ ship_default_project: 'default'
94
94
  ship_docker_host: '32375'
95
95
  ship_env: ''
96
96
  ship_hostname: '%{ship_name}_%{unique}'
97
+ ship_images_sync: 'true'
97
98
  ship_name: 'takelship'
98
99
  ship_podman_localhost: '127.0.0.1'
99
100
  ship_repo: 'takelship'
@@ -172,7 +172,7 @@ module SystemModule
172
172
  true
173
173
  end
174
174
 
175
- # Read yaml file.
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 "Invalid YAML file \"#{file}\""
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
- args_nonprivileged = config.active['ship_run_args_nonprivileged']
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
- args_privileged = config.active['ship_run_args_privileged']
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
- output << "#{url.ljust(max_length['url'])} #{service.ljust(max_length['service'])}#{description}"
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
- say output.join("\n")
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.6
1
+ 0.45.9
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takeltau
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.45.6
4
+ version: 0.45.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takelwerk