takeltau 0.45.14 → 0.45.17

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: 3c88546f57b7641ceeb01f2aca88a18ec553343c5ff822406fdc88105965274c
4
- data.tar.gz: 5430e736adc4fb7055deff87733c78be352c74cdb3e2d96511119603c1f5dbbe
3
+ metadata.gz: 29a44c58a0f65c5af312f122d9045fa3fdcb2bb6cf1d18f9aea0fb78b849931e
4
+ data.tar.gz: c6403cd84660b3ab9a87cacec5e25922a24893c4325b448889cee17fd0563a2e
5
5
  SHA512:
6
- metadata.gz: e22aa5ce53cc93437c91edc3066280d29e6a1de3075266c208cf6bcb02ef97832e482ed22af5a3eff5a834b477bfd9b63141ada90e87300071cef3743966de3f
7
- data.tar.gz: df592a803fbec57a22b6f037311a19134a1775f3a1c2b71d955e2f41181d5ab13357ca4cb2d9a985ac865a5869a39a505d118d11d704f3e9e4df9fe309e1b6b9
6
+ metadata.gz: 502b2a590318258ca0460b0c2384b2efb6676ff13d16ed19ff6d344c2490b17dd61aaacc1e4da07fdd0a6d83299a23e4ef41a026649c23849aece9ca39422ef6
7
+ data.tar.gz: f1eccb654f5ae730d28dfe034b2412f431d9cd54d383a97d889df2f766cd44127b447c70bc3fbb3665518897bb80e1f94da1dc24f15de4e6ec405d6a3454a91b
@@ -62,6 +62,7 @@ cmd_ship_container_login: 'bash'
62
62
  cmd_ship_container_logs: '%{ship_docker} logs %{ship_hostname} %{args}'
63
63
  cmd_ship_docker: 'docker'
64
64
  cmd_ship_docker_check: 'docker --version'
65
+ cmd_ship_docker_wait: '%{ship_docker} wait %{ship_hostname}'
65
66
  cmd_ship_docker_stop: '%{ship_docker} kill %{ship_hostname}'
66
67
  cmd_ship_project_start_docker_run_nonprivileged: '%{ship_docker} run --rm --interactive %{ship_run_args_nonprivileged} %{image} %{command}'
67
68
  cmd_ship_project_start_docker_run_privileged: '%{ship_docker} run --privileged --rm --detach --name %{ship_hostname} --hostname %{ship_hostname} %{ship_env} %{ports} --volume %{project_root_dir}/%{ship_data_dir}:/home/podman/takelship %{ship_run_args_privileged} %{image} %{command}'
@@ -7,26 +7,12 @@ module ShipInfoLib
7
7
  # Gather takelship information
8
8
  def _ship_info_lib_get_takelshipinfo
9
9
  log.debug 'Gathering takelship info'
10
- takelshipinfo = _ship_info_lib_get_info_from_file
11
- takelshipinfo = _ship_info_lib_get_info_from_docker if takelshipinfo.empty?
12
-
10
+ takelshipinfo = _ship_info_lib_get_info_from_docker
13
11
  return false if takelshipinfo.nil?
14
12
 
15
13
  takelshipinfo
16
14
  end
17
15
 
18
- # Read takelship info from file
19
- def _ship_info_lib_get_info_from_file
20
- log.debug 'Reading takelship info from file'
21
- ship_data_dir = config.active['ship_data_dir']
22
- yaml_file = format(
23
- config.active['ship_takelship_yml'],
24
- pwd: Dir.getwd,
25
- ship_data_dir: ship_data_dir
26
- )
27
- read_yaml_file(yaml_file) || {}
28
- end
29
-
30
16
  # Read takelship info from docker run
31
17
  def _ship_info_lib_get_info_from_docker
32
18
  log.debug 'Reading takelship info from takelship container'
@@ -35,6 +21,8 @@ module ShipInfoLib
35
21
  end
36
22
 
37
23
  def _ship_info_lib_get_project(project, takelship)
24
+ return '' if takelship.nil?
25
+
38
26
  return '' unless takelship.key? 'default_project'
39
27
 
40
28
  project = config.active['ship_default_project'] if project == 'default'
@@ -15,6 +15,7 @@ module Takeltau
15
15
  include ShipPortsLib
16
16
  include ShipProjectCreate
17
17
  include ShipProjectList
18
+ include ShipProjectRestart
18
19
  include ShipProjectStart
19
20
 
20
21
  #
@@ -51,8 +52,7 @@ module Takeltau
51
52
  LONGDESC
52
53
  # ship restart: {Takeltau::ShipProject#restart}
53
54
  def restart(project = 'default')
54
- Takeltau::ShipProject.new.stop
55
- Takeltau::ShipProject.new.start project
55
+ exit ship_project_restart project
56
56
  end
57
57
 
58
58
  #
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # tau ship project restart
4
+ module ShipProjectRestart
5
+ # Restart a takelship
6
+ def ship_project_restart(project)
7
+ say ship_container_stop
8
+ _ship_project_restart_wait
9
+ ship_project_start project
10
+ end
11
+
12
+ private
13
+
14
+ # Wait until a takelship container is stopped
15
+ def _ship_project_restart_wait
16
+ cmd_ship_docker_wait = format(
17
+ config.active['cmd_ship_docker_wait'],
18
+ ship_docker: config.active['cmd_ship_docker'],
19
+ ship_hostname: _ship_container_lib_ship_hostname
20
+ )
21
+
22
+ run cmd_ship_docker_wait
23
+ end
24
+ end
@@ -7,6 +7,11 @@ module ShipProjectStart
7
7
  return false unless _ship_project_start_matrjoschka?
8
8
 
9
9
  takelship = _ship_info_lib_get_takelshipinfo
10
+ unless takelship
11
+ log.debug 'Unable to gather takelship info'
12
+ return false
13
+ end
14
+
10
15
  project = _ship_info_lib_get_project project, takelship
11
16
  return false unless _ship_project_start_valid_project? takelship, project
12
17
 
data/lib/takeltau/version CHANGED
@@ -1 +1 @@
1
- 0.45.14
1
+ 0.45.17
data/lib/takeltau.rb CHANGED
@@ -104,6 +104,7 @@ require_relative 'takeltau/ship/ports/list'
104
104
  require_relative 'takeltau/ship/ports/cli'
105
105
  require_relative 'takeltau/ship/project/create'
106
106
  require_relative 'takeltau/ship/project/list'
107
+ require_relative 'takeltau/ship/project/restart'
107
108
  require_relative 'takeltau/ship/project/start'
108
109
  require_relative 'takeltau/ship/project/cli'
109
110
  require_relative 'takeltau/ship/cli'
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.14
4
+ version: 0.45.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takelwerk
@@ -307,6 +307,7 @@ files:
307
307
  - lib/takeltau/ship/project/cli.rb
308
308
  - lib/takeltau/ship/project/create.rb
309
309
  - lib/takeltau/ship/project/list.rb
310
+ - lib/takeltau/ship/project/restart.rb
310
311
  - lib/takeltau/ship/project/start.rb
311
312
  - lib/takeltau/version
312
313
  homepage: https://github.com/takelwerk/takelage-cli