takeltau 0.44.24 → 0.44.29

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: deb82fda940a4ff5a0a2bf71cc84bf813589c07eda38a3d2040f825738b1d443
4
- data.tar.gz: d41134f25c52879dcba44f08a6fdd4b910a884a410f02728d5f2413ae70c5338
3
+ metadata.gz: 4af5fc9f1930e7b6b11e1ebf4d2af883e8db4637595392ab80856e214d96659a
4
+ data.tar.gz: f65c12c5676d3a4df61fe5fb90280446486af6bdd7ed8d47e5db4f546403f3b4
5
5
  SHA512:
6
- metadata.gz: 2245845fa2cfe9ab835d416dc7502487cbedcc652a8e6191ddeb69267f9dc48d0e81a96d9f04ed985972e645da8da8fe861ac4695fff6f0a94f65ec8dcb85b80
7
- data.tar.gz: 73b097fe9c5426567c53a2d7b1d95e92b7d0ca25817d6731f0cc32b9765efbf2016a96a7cd5d3d4d482e864d1d9844dae537cb58beb2f6c32ed463c0b5f999ab
6
+ metadata.gz: 89433fe5f3335b761215eeb7733757befb4bf7549ddd4caf78249f8f436199abd3876a045114eef09e0574380e8354d8f1fbafaaba2165f5de790753d90b4da8
7
+ data.tar.gz: 93800b4cf6a686a44777d91d3adf6c611fe29e016b74c30f813bf9347d2e79393a7e20e68ff7a8adc68e0c8a77d4e831c1099be3206b98af13220160f54a9633
data/README.md CHANGED
@@ -127,7 +127,7 @@ or *tau commands*:
127
127
  | tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature) | List takelships |
128
128
  | tau [ship container hostname](features/cucumber/features/ship/container/ship.container.hostname.feature) | Print takelship hostname |
129
129
  | tau [ship container login](features/cucumber/features/ship/container/ship.container.login.feature) | Log in to a takelship |
130
- | tau [ship container logs](features/cucumber/features/ship/container/ship.container.logs.feature) | Print the takelship logs |
130
+ | tau [ship container logs](features/cucumber/features/ship/container/ship.container.logs.feature) [ARGS] | Print the takelship logs |
131
131
  | tau [ship container name](features/cucumber/features/ship/container/ship.container.name.feature) | Print the takelship name |
132
132
  | tau [ship container podman](features/cucumber/features/ship/container/ship.container.podman.feature) [CMD] | Run a podman command in a takelship |
133
133
  | tau [ship container shipdir](features/cucumber/features/ship/container/ship.container.shipdir.feature) | Print takelship shipdir |
@@ -148,7 +148,7 @@ or *tau commands*:
148
148
  | tau ship docker [CMD] | Alias for tau [ship container podman](features/cucumber/features/ship/container/ship.container.podman.feature) |
149
149
  | tau ship list | Alias for tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature) |
150
150
  | tau ship login | Alias for tau [ship container login](features/cucumber/features/ship/container/ship.container.login.feature) |
151
- | tau ship logs | Alias for tau [ship container logs](features/cucumber/features/ship/container/ship.container.logs.feature) |
151
+ | tau ship logs [ARGS] | Alias for tau [ship container logs](features/cucumber/features/ship/container/ship.container.logs.feature) |
152
152
  | tau ship ls | Alias for tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature) |
153
153
  | tau ship name | Alias for tau [ship container list](features/cucumber/features/ship/container/ship.container.name.feature) |
154
154
  | tau ship podman [CMD] | Alias for tau [ship container podman](features/cucumber/features/ship/container/ship.container.podman.feature) |
@@ -52,7 +52,7 @@ module Takeltau
52
52
  LONGDESC
53
53
  # ship clean: {Takeltau::ShipProject#clean}
54
54
  def clean
55
- Takeltau::ShipProject.new.clean
55
+ Takeltau::ShipContainer.new.clean
56
56
  end
57
57
 
58
58
  desc 'command [CMD]', 'Run a bash command in a takelship'
@@ -95,7 +95,7 @@ module Takeltau
95
95
  Takeltau::ShipContainer.new.login
96
96
  end
97
97
 
98
- desc 'logs [OPTIONS]', 'Print the takelship logs'
98
+ desc 'logs [ARGS]', 'Print the takelship logs'
99
99
  long_desc <<-LONGDESC.gsub("\n", "\x5")
100
100
  Print the takelship logs.
101
101
  Alias for ship container logs.
@@ -83,7 +83,7 @@ module Takeltau
83
83
  #
84
84
  # ship container logs
85
85
  #
86
- desc 'logs [OPTIONS]', 'Print the takelship logs'
86
+ desc 'logs [ARGS]', 'Print the takelship logs'
87
87
  long_desc <<-LONGDESC.gsub("\n", "\x5")
88
88
  Print the takelship logs.
89
89
  Accepts docker logs options.
@@ -44,7 +44,7 @@ module ShipContainerLib
44
44
  image: _ship_container_lib_image,
45
45
  command: command
46
46
  )
47
- run cmd_docker_run_command
47
+ run_and_capture cmd_docker_run_command
48
48
  end
49
49
 
50
50
  # rubocop:enable Metrics/MethodLength
@@ -6,7 +6,8 @@ module ShipPortsLib
6
6
 
7
7
  # get the ports of a takelship
8
8
  def _ship_ports_lib_get_ports(takelship, takelproject)
9
- ports = _ship_ports_lib_get_ports_docker(takelship)
9
+ ports = _ship_ports_lib_get_port_docker(takelship)
10
+ ports = ports.merge _ship_ports_lib_get_port_takelship_registry
10
11
  takelship['projects'].each do |project|
11
12
  next unless project['name'] == takelproject
12
13
 
@@ -15,7 +16,8 @@ module ShipPortsLib
15
16
 
16
17
  service['ports'].each do |port|
17
18
  key = _ship_ports_lib_generate_key port, service
18
- ports[key] = _ship_ports_lib_get_port key, port, service
19
+ port = _ship_ports_lib_get_port key, port, service
20
+ ports = ports.merge port
19
21
  end
20
22
  end
21
23
  end
@@ -45,8 +47,7 @@ module ShipPortsLib
45
47
  end
46
48
 
47
49
  # map the podman socket port (aka "DOCKER_HOST")
48
- # returns a hash unlike the get_port method
49
- def _ship_ports_lib_get_ports_docker(takelship)
50
+ def _ship_ports_lib_get_port_docker(takelship)
50
51
  takel_docker = takelship['docker_host']
51
52
  docker_key = "ship_ports_docker_host_docker_#{takel_docker}"
52
53
  local_docker = _ship_ports_lib_get_localhost_port docker_key, takel_docker
@@ -62,24 +63,42 @@ module ShipPortsLib
62
63
  }
63
64
  end
64
65
 
66
+ # map the internal registry port
67
+ def _ship_ports_lib_get_port_takelship_registry
68
+ registry_key = 'ship_ports_takelship_registry_http_5555'
69
+ registry_port = _ship_ports_lib_get_localhost_port(registry_key, 35_555)
70
+ {
71
+ registry_key => {
72
+ 'service' => 'takelship-registry',
73
+ 'protocol' => 'http',
74
+ 'takelship' => 5555,
75
+ 'localhost' => registry_port.to_i
76
+ }
77
+ }
78
+ end
79
+
65
80
  # map a takelship port
66
81
  def _ship_ports_lib_get_port(key, port, service)
67
82
  localhost = _ship_ports_lib_get_localhost_port key, port['port']
68
83
  unless port.key?('description')
69
84
  return {
70
- 'service' => service['name'],
71
- 'protocol' => port['protocol'],
72
- 'takelship' => port['port'],
73
- 'localhost' => localhost
85
+ key => {
86
+ 'service' => service['name'],
87
+ 'protocol' => port['protocol'],
88
+ 'takelship' => port['port'],
89
+ 'localhost' => localhost
90
+ }
74
91
  }
75
92
  end
76
93
 
77
94
  {
78
- 'service' => service['name'],
79
- 'protocol' => port['protocol'],
80
- 'takelship' => port['port'],
81
- 'localhost' => localhost,
82
- 'description' => port['description']
95
+ key => {
96
+ 'service' => service['name'],
97
+ 'protocol' => port['protocol'],
98
+ 'takelship' => port['port'],
99
+ 'localhost' => localhost,
100
+ 'description' => port['description']
101
+ }
83
102
  }
84
103
  end
85
104
 
@@ -17,7 +17,9 @@ module ShipProjectStart
17
17
  _ship_ports_lib_write_ports(ports, project)
18
18
 
19
19
  log.debug "Starting takelship project \"#{project}\""
20
- _ship_container_lib_docker_privileged ports, project
20
+ ship_status = _ship_container_lib_docker_privileged ports, project
21
+ return false unless _ship_container_lib_started? ship_status
22
+
21
23
  _ship_project_start_print_banner project
22
24
  _ship_project_start_print_ports ports
23
25
  true
@@ -51,6 +53,15 @@ module ShipProjectStart
51
53
  false
52
54
  end
53
55
 
56
+ # check if the ship started successfully
57
+ def _ship_container_lib_started?(ship_status)
58
+ return true if ship_status[2].zero?
59
+
60
+ say 'Unable to start the takelship. The error message was:'
61
+ say ship_status[1].to_s.strip.delete_prefix('"').delete_suffix('"')
62
+ false
63
+ end
64
+
54
65
  # print banner with status information
55
66
  def _ship_project_start_print_banner(project)
56
67
  ship_hostname = _ship_container_lib_ship_hostname
data/lib/takeltau/version CHANGED
@@ -1 +1 @@
1
- 0.44.24
1
+ 0.44.29
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.44.24
4
+ version: 0.44.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takelwerk