takeltau 0.43.16 → 0.43.19
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 +36 -30
- data/lib/takeltau/docker/check/daemon.rb +3 -7
- data/lib/takeltau/docker/cli.rb +14 -0
- data/lib/takeltau/docker/container/check/existing.rb +0 -2
- data/lib/takeltau/docker/container/check/network.rb +0 -2
- data/lib/takeltau/docker/container/check/orphaned.rb +0 -2
- data/lib/takeltau/docker/container/clean.rb +0 -2
- data/lib/takeltau/docker/container/command.rb +0 -2
- data/lib/takeltau/docker/container/daemon.rb +0 -2
- data/lib/takeltau/docker/container/lib.rb +19 -1
- data/lib/takeltau/docker/container/list.rb +9 -4
- data/lib/takeltau/docker/container/login.rb +0 -2
- data/lib/takeltau/docker/container/prune.rb +0 -2
- data/lib/takeltau/docker/image/tag/check.rb +0 -2
- data/lib/takeltau/docker/image/tag/latest.rb +0 -2
- data/lib/takeltau/docker/image/update.rb +0 -2
- data/lib/takeltau/init/lib.rb +1 -1
- data/lib/takeltau/lib/config.rb +13 -20
- data/lib/takeltau/lib/project.rb +1 -1
- data/lib/takeltau/lib/system.rb +25 -17
- data/lib/takeltau/mutagen/check/daemon.rb +2 -6
- data/lib/takeltau/mutagen/cli.rb +18 -0
- data/lib/takeltau/self/config/cli.rb +17 -0
- data/lib/takeltau/ship/cli.rb +13 -6
- data/lib/takeltau/ship/container/check/existing.rb +3 -5
- data/lib/takeltau/ship/container/clean.rb +30 -0
- data/lib/takeltau/ship/container/cli.rb +29 -4
- data/lib/takeltau/ship/container/lib.rb +11 -20
- data/lib/takeltau/ship/container/list.rb +4 -4
- data/lib/takeltau/ship/container/login.rb +0 -2
- data/lib/takeltau/ship/container/podman.rb +0 -2
- data/lib/takeltau/ship/container/stop.rb +23 -0
- data/lib/takeltau/ship/container/update.rb +0 -2
- data/lib/takeltau/ship/project/cli.rb +2 -1
- data/lib/takeltau/ship/project/start.rb +9 -4
- data/lib/takeltau/version +1 -1
- data/lib/takeltau.rb +2 -6
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b433846c95247973be471defc8590126e5271d13069fa300f0abbd1f5c5e580
|
4
|
+
data.tar.gz: a94d442031c78bddb68f2789732f5f98ddbbbcd7819b59053becc20a218d5ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e334b9e260c0cc13ac64dd0dc1caa0aff76bcb8d9d67ce4ca5143bacb6447ee9e17c5ae20718b6532ffb226c66397048a26cd08b0b0462f1a88bb5b49f4a243
|
7
|
+
data.tar.gz: c7059141332e62277af38fabb1aa411f1e260470cea3bee256d4812e053a26d94e155c37ae5829bc176cc37576cf70a00c40704214bed5163205108509c792fd
|
data/lib/takeltau/default.yml
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
---
|
2
2
|
cmd_docker: 'docker'
|
3
|
-
|
3
|
+
cmd_docker_check: 'docker --version'
|
4
|
+
cmd_docker_check_daemon_info: "%{docker} info --format '{{ .ServerVersion}}'"
|
4
5
|
cmd_docker_container_check_existing_docker_ps: '%{docker} ps --filter name=^%{container}$ --quiet'
|
5
|
-
cmd_docker_container_check_network_docker_network: '%{docker} network ls --
|
6
|
+
cmd_docker_container_check_network_docker_network: '%{docker} network ls --filter name=^%{network}$ --quiet'
|
6
7
|
cmd_docker_container_check_orphaned_docker_exec: '%{docker} exec --interactive %{container} ps a'
|
7
|
-
cmd_docker_container_create: '%{docker} run --detach --env TAKELAGE_PROJECT_BASE_DIR=%{workdir} --env TZ=%{timezone} --hostname %{container} --name %{container} --network %{container} --rm --shm-size %{shmsize} --tty --volume %{
|
8
|
+
cmd_docker_container_create: '%{docker} run --detach --env TAKELAGE_PROJECT_BASE_DIR=%{workdir} --env TZ=%{timezone} --hostname %{container} --name %{container} --network %{container} --rm --shm-size %{shmsize} --tty --volume %{workdir}:/project %{volume_dev} --volume %{homedir}:/hostdir --workdir /project %{docker_run_options} %{image} %{entrypoint} --gid %{gid} --home %{homedir} --uid %{uid} --username %{username} --extra=%{extra} %{entrypoint_options}'
|
8
9
|
cmd_docker_container_create_network: '%{docker} network create %{network}'
|
10
|
+
cmd_docker_container_docker_exec: '%{docker} exec %{container} su %{username} -c "LANG=en_US.UTF-8 %{command}"'
|
9
11
|
cmd_docker_container_enter_container: '%{docker} exec --interactive --tty %{container} %{loginpoint} --username %{username}'
|
10
12
|
cmd_docker_container_get_container_name: '%{docker} ps --filter id=%{container} --format "{{.Names}}"'
|
11
13
|
cmd_docker_container_get_containers: '%{docker} ps --all --filter name=^%{docker_repo}_ --quiet'
|
14
|
+
cmd_docker_container_get_mounted_dir: "%{docker} container inspect %{name} --format '{{range .Mounts}}{{ if eq .Destination %{dest_dir} }}{{println .Source }}{{ end }}{{end}}'"
|
12
15
|
cmd_docker_container_remove_network: '%{docker} network rm %{network}'
|
13
|
-
cmd_docker_container_docker_exec: '%{docker} exec %{container} su %{username} -c "LANG=en_US.UTF-8 %{command}"'
|
14
16
|
cmd_docker_container_stop_container: '%{docker} stop %{container}'
|
15
17
|
cmd_docker_image_tag_check_docker_images: '%{docker} images --quiet %{image}'
|
16
18
|
cmd_docker_image_tag_list_docker_images: '%{docker} images %{docker_user}\/%{docker_repo} --format "{{.Tag}}"'
|
17
19
|
cmd_docker_image_update_docker_pull: '%{docker} pull %{docker_user}/%{docker_repo}:%{docker_tag}'
|
18
20
|
cmd_docker_image_update_docker_remove_dangling: '%{docker} image prune --force'
|
19
21
|
cmd_git: 'git'
|
20
|
-
|
21
|
-
cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
|
22
|
+
cmd_git_check: 'git --version'
|
22
23
|
cmd_git_check_clean_git_status: 'git status --porcelain'
|
24
|
+
cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
|
25
|
+
cmd_git_check_clean_git_unstaged: 'git diff --exit-code'
|
23
26
|
cmd_git_check_hg_get_git_branch: 'git symbolic-ref HEAD'
|
24
27
|
cmd_git_check_workspace_git_repo: 'git -C %{dir} rev-parse'
|
25
28
|
cmd_git_check_workspace_pwd: 'pwd'
|
@@ -30,29 +33,38 @@ cmd_git_lib_git_push_origin: 'git push origin %{main}'
|
|
30
33
|
cmd_hg_list_repos: 'cd %{root}; find * -type d -name ".hg" | parallel --keep-order hg paths default --repository {//} --template "hg\ clone\ {url}\ " \; echo {//}'
|
31
34
|
cmd_hg_pull_repos: 'cd %{root}; find * -type d -name ".hg" | parallel --keep-order echo \; cd {//} \; pwd \; hg pull --update'
|
32
35
|
cmd_hg_push_repos: 'cd %{root}; find * -type d -name ".hg" | parallel --keep-order echo \; cd {//} \; pwd \; hg commit --addremove --message "Update\ hg\ repos" \; hg bookmarks --force main \; hg push'
|
33
|
-
cmd_info_status_lib_git_name: 'git -C %{root} config user.name'
|
34
|
-
cmd_info_status_lib_git_email: 'git -C %{root} config user.email'
|
35
|
-
cmd_info_status_lib_git_signingkey: 'git -C %{root} config user.signingKey'
|
36
|
-
cmd_info_status_lib_git_key_available: 'gpg --list-key %{key}'
|
37
36
|
cmd_info_status_arch_get_arch: 'arch'
|
38
37
|
cmd_info_status_gopass_root_store: 'gopass config | grep "path" | cut -d " " -f 2'
|
39
38
|
cmd_info_status_gpg_agent: 'gpg-connect-agent /bye'
|
40
39
|
cmd_info_status_gpg_keys: 'gpg --list-keys'
|
41
40
|
cmd_info_status_hg_username: 'hg config ui.username'
|
41
|
+
cmd_info_status_lib_git_email: 'git -C %{root} config user.email'
|
42
|
+
cmd_info_status_lib_git_key_available: 'gpg --list-key %{key}'
|
43
|
+
cmd_info_status_lib_git_name: 'git -C %{root} config user.name'
|
44
|
+
cmd_info_status_lib_git_signingkey: 'git -C %{root} config user.signingKey'
|
42
45
|
cmd_info_status_ssh_keys: 'ssh-add -l'
|
43
46
|
cmd_info_status_ssh_socket: 'gpgconf --list-dirs agent-ssh-socket'
|
44
|
-
cmd_init_lib_git_init: 'git init && git checkout -b main'
|
45
47
|
cmd_init_lib_git_add_all: 'git add --all'
|
46
48
|
cmd_init_lib_git_commit_initial: 'git commit -m "Initial commit"'
|
49
|
+
cmd_init_lib_git_init: 'git init && git checkout -b main'
|
47
50
|
cmd_init_lib_hg_clone: 'bash hgclone'
|
48
51
|
cmd_mutagen: 'mutagen'
|
52
|
+
cmd_mutagen_check: 'mutagen --version'
|
49
53
|
cmd_mutagen_check_daemon_host_connection: 'mutagen forward list --label-selector="%{hostlabel}"'
|
54
|
+
cmd_mutagen_forward_socket_check: 'mutagen forward list %{socketname}'
|
50
55
|
cmd_mutagen_forward_socket_create: 'mutagen forward create --name=%{socketname} --label=%{hostlabel} --label=%{takellabel} docker://%{username}@%{container}:unix:%{containersock} unix:%{hostsock}'
|
51
56
|
cmd_mutagen_forward_socket_docker: 'mutagen forward create --name=%{socketname} --label=%{hostlabel} --label=%{takellabel} --socket-group-source=docker --socket-permission-mode=0660 docker://root@%{container}:unix:/var/run/docker.sock unix:%{hostsock}'
|
52
|
-
cmd_mutagen_forward_socket_check: 'mutagen forward list %{socketname}'
|
53
|
-
cmd_mutagen_forward_socket_terminate: 'mutagen forward terminate %{socketname}'
|
54
|
-
cmd_mutagen_forward_socket_remove: 'rm -f ~/.mutagen/daemon/*'
|
55
57
|
cmd_mutagen_forward_socket_list: 'mutagen forward list --label-selector="%{takellabel}"'
|
58
|
+
cmd_mutagen_forward_socket_remove: 'rm -f ~/.mutagen/daemon/*'
|
59
|
+
cmd_mutagen_forward_socket_terminate: 'mutagen forward terminate %{socketname}'
|
60
|
+
cmd_ship_container_docker: '%{ship_docker} exec --interactive %{tty} %{ship_hostname} %{command}'
|
61
|
+
cmd_ship_container_login: 'bash'
|
62
|
+
cmd_ship_docker: 'docker'
|
63
|
+
cmd_ship_docker_check: 'docker --version'
|
64
|
+
cmd_ship_project_start_docker_run_nonprivileged: '%{ship_docker} run --rm --interactive %{image} %{command}'
|
65
|
+
cmd_ship_project_start_docker_run_privileged: '%{ship_docker} run --privileged --rm --detach --name %{ship_hostname} --hostname %{ship_hostname} %{ship_env} %{ports} --volume ./%{ship_data_dir}:/home/podman/takelship %{image} %{command}'
|
66
|
+
cmd_ship_project_start_docker_stop: '%{ship_docker} stop %{ship_hostname}'
|
67
|
+
docker_container_check_matrjoschka: 'true'
|
56
68
|
docker_debug: 'ansible/roles/takel_takelage/files/takelscripts'
|
57
69
|
docker_entrypoint_extra: ''
|
58
70
|
docker_entrypoint_options: ''
|
@@ -74,24 +86,18 @@ mutagen_socket_path_mutagen_host: '~/.mutagen/daemon/daemon.sock'
|
|
74
86
|
mutagen_socket_path_ssh_container: '~/.gnupg/S.gpg-agent.ssh'
|
75
87
|
mutagen_socket_path_ssh_host: '~/.gnupg/S.gpg-agent.ssh'
|
76
88
|
mutagen_socket_takelage_label: 'type=takelage'
|
77
|
-
|
78
|
-
|
89
|
+
ship_container_check_matrjoschka: 'true'
|
90
|
+
ship_data_dir: 'takelship'
|
91
|
+
ship_default_docker_host: '32375'
|
79
92
|
ship_default_project: 'default'
|
93
|
+
ship_docker_host: '32375'
|
80
94
|
ship_env: '--env TAKELSHIP_UPDATE=true'
|
95
|
+
ship_hostname: '%{ship_name}_%{unique}'
|
96
|
+
ship_name: 'takelship'
|
97
|
+
ship_podman_localhost: '127.0.0.1'
|
81
98
|
ship_ports: ''
|
82
|
-
|
99
|
+
ship_port_expose_podman_socket: 'false'
|
83
100
|
ship_repo: 'takelship'
|
84
101
|
ship_tag: 'latest'
|
85
|
-
|
86
|
-
|
87
|
-
ship_podman_localhost: '127.0.0.1'
|
88
|
-
ship_docker_host: '32375'
|
89
|
-
ship_default_docker_host: '32375'
|
90
|
-
cmd_ship_docker: 'docker'
|
91
|
-
cmd_ship_project_start_docker_run_nonprivileged: '%{ship_docker} run --rm --interactive %{image} %{command}'
|
92
|
-
cmd_ship_project_start_docker_run_privileged: '%{ship_docker} run --privileged --rm --detach --name %{ship_hostname} --hostname %{ship_hostname} %{ship_env} %{ports} --volume ./%{ship_data_dir}:/home/podman/takelship %{image} %{command}'
|
93
|
-
cmd_ship_project_start_docker_stop: '%{ship_docker} stop %{ship_hostname}'
|
94
|
-
cmd_ship_container_check_existing_docker_ps: '%{ship_docker} ps --filter name=^%{ship_name}$ --quiet'
|
95
|
-
cmd_ship_container_docker: '%{ship_docker} exec --interactive %{tty} %{ship_hostname} %{command}'
|
96
|
-
cmd_ship_container_login: 'bash'
|
97
|
-
cmd_docker_container_get_mounted_dir: '%{ship_docker} container inspect %{ship_hostname} --format "{{ (index .Mounts 0).Source }}"'
|
102
|
+
ship_takelship_yml: '%{pwd}/%{ship_data_dir}/compose/takelship.yml'
|
103
|
+
ship_user: 'takelwerk'
|
@@ -6,15 +6,12 @@ module DockerCheckDaemon
|
|
6
6
|
# @return [Boolean] is the docker daemon running?
|
7
7
|
# rubocop:disable Metrics/MethodLength
|
8
8
|
# rubocop:disable Metrics/AbcSize
|
9
|
-
def docker_check_daemon(docker = 'cmd_docker')
|
10
|
-
return
|
11
|
-
|
12
|
-
return false unless command_available_else_error? config.active['cmd_docker']
|
9
|
+
def docker_check_daemon(docker = 'cmd_docker', docker_check = 'cmd_docker_check')
|
10
|
+
return false unless command_available_else_error? config.active[docker_check]
|
13
11
|
|
14
12
|
log.debug 'Check if the docker daemon is running'
|
15
|
-
|
16
13
|
cmd_docker_info = format(
|
17
|
-
config.active['
|
14
|
+
config.active['cmd_docker_check_daemon_info'],
|
18
15
|
docker: config.active[docker]
|
19
16
|
)
|
20
17
|
status = try cmd_docker_info
|
@@ -25,7 +22,6 @@ module DockerCheckDaemon
|
|
25
22
|
end
|
26
23
|
|
27
24
|
log.debug 'The docker daemon is running'
|
28
|
-
@docker_daemon_running = true
|
29
25
|
true
|
30
26
|
end
|
31
27
|
# rubocop:enable Metrics/AbcSize
|
data/lib/takeltau/docker/cli.rb
CHANGED
@@ -3,6 +3,20 @@
|
|
3
3
|
module Takeltau
|
4
4
|
# tau docker
|
5
5
|
class Docker < SubCommandBase
|
6
|
+
# Initialize docker
|
7
|
+
include LoggingModule
|
8
|
+
include SystemModule
|
9
|
+
include ConfigModule
|
10
|
+
include DockerCheckDaemon
|
11
|
+
|
12
|
+
def initialize(args = [], local_options = {}, configuration = {})
|
13
|
+
# initialize thor parent class
|
14
|
+
super args, local_options, configuration
|
15
|
+
|
16
|
+
log.debug 'Check docker dameon for docker subcommand'
|
17
|
+
exit false unless docker_check_daemon
|
18
|
+
end
|
19
|
+
|
6
20
|
desc 'check [COMMAND]', 'Check docker'
|
7
21
|
subcommand 'check', DockerCheck
|
8
22
|
|
@@ -8,8 +8,6 @@ module DockerContainerCheckExisting
|
|
8
8
|
def docker_container_check_existing(container)
|
9
9
|
log.debug "Checking if container \"#{container}\" is existing"
|
10
10
|
|
11
|
-
return false unless docker_check_daemon
|
12
|
-
|
13
11
|
stdout_str = run _docker_container_cmd_check_existing container
|
14
12
|
|
15
13
|
if stdout_str.to_s.chomp.empty?
|
@@ -7,8 +7,6 @@ module DockerContainerCheckNetwork
|
|
7
7
|
def docker_container_check_network(network)
|
8
8
|
log.debug "Checking if network \"#{network}\" is existing"
|
9
9
|
|
10
|
-
return false unless docker_check_daemon
|
11
|
-
|
12
10
|
stdout_str = run _docker_container_cmd_check_network network
|
13
11
|
|
14
12
|
if stdout_str.to_s.chomp.empty?
|
@@ -7,8 +7,6 @@ module DockerContainerCheckOrphaned
|
|
7
7
|
def docker_container_check_orphaned(container)
|
8
8
|
log.debug "Check if container \"#{container}\" is orphaned"
|
9
9
|
|
10
|
-
return false unless docker_check_daemon
|
11
|
-
|
12
10
|
stdout_str = run _docker_container_cmd_check_orphaned container
|
13
11
|
|
14
12
|
if stdout_str.include? '/loginpoint.py'
|
@@ -6,8 +6,6 @@ module DockerContainerClean
|
|
6
6
|
def docker_container_clean
|
7
7
|
log.debug 'Removing all docker containers'
|
8
8
|
|
9
|
-
return false unless docker_check_daemon
|
10
|
-
|
11
9
|
return false if _docker_container_clean_harakiri?
|
12
10
|
|
13
11
|
mutagen_socket_terminate "--label-selector='#{@takellabel}'"
|
@@ -115,8 +115,11 @@ module DockerContainerLib
|
|
115
115
|
|
116
116
|
# Check if we are already inside a takelage container
|
117
117
|
def _docker_container_lib_check_matrjoschka
|
118
|
-
|
118
|
+
return false unless config.active['docker_container_check_matrjoschka']
|
119
|
+
|
120
|
+
return false unless config.active['ship_container_check_matrjoschka']
|
119
121
|
|
122
|
+
log.debug 'Checking if we are already inside a takelage container'
|
120
123
|
unless ENV.keys.include? 'TAKELAGE_PROJECT_BASE_DIR'
|
121
124
|
log.debug 'We are not inside a takelage container'
|
122
125
|
return false
|
@@ -177,6 +180,21 @@ module DockerContainerLib
|
|
177
180
|
|
178
181
|
run cmd_docker_stop
|
179
182
|
end
|
183
|
+
|
184
|
+
# Get the mounted takelage directory
|
185
|
+
def _docker_container_lib_get_mounted_dir(name, destination, docker)
|
186
|
+
log.debug 'Getting mounted directory from ' \
|
187
|
+
"container \"#{name}\""
|
188
|
+
|
189
|
+
cmd_get_mounted_dir = format(
|
190
|
+
config.active['cmd_docker_container_get_mounted_dir'],
|
191
|
+
docker: docker,
|
192
|
+
name: name,
|
193
|
+
dest_dir: "\"#{destination}\""
|
194
|
+
)
|
195
|
+
|
196
|
+
(run cmd_get_mounted_dir).strip
|
197
|
+
end
|
180
198
|
end
|
181
199
|
# rubocop:enable Style/IfUnlessModifier
|
182
200
|
# rubocop:enable Metrics/ModuleLength
|
@@ -6,26 +6,31 @@ module DockerContainerList
|
|
6
6
|
def docker_container_list
|
7
7
|
log.debug 'List docker containers'
|
8
8
|
|
9
|
-
return false unless docker_check_daemon
|
10
|
-
|
11
9
|
_docker_container_list_get_inventory.to_yaml
|
12
10
|
end
|
13
11
|
|
14
12
|
private
|
15
13
|
|
16
14
|
# Get the current inventory
|
15
|
+
# rubocop:disable Metrics/AbcSize
|
16
|
+
# rubocop:disable Metrics/MethodLength
|
17
17
|
def _docker_container_list_get_inventory
|
18
|
+
destination = '/project'
|
19
|
+
docker = config.active['cmd_docker']
|
18
20
|
inventory = _docker_container_list_new_inventory
|
19
21
|
_docker_container_lib_get_containers.each do |container|
|
20
22
|
name = _docker_container_lib_get_container_name_by_id container
|
23
|
+
dir = (_docker_container_lib_get_mounted_dir name, destination, docker).strip
|
21
24
|
if docker_container_check_orphaned container
|
22
|
-
inventory['orphaned']['hosts'] << name
|
25
|
+
inventory['orphaned']['hosts'] << { name => dir }
|
23
26
|
else
|
24
|
-
inventory['login']['hosts'] << name
|
27
|
+
inventory['login']['hosts'] << { name => dir }
|
25
28
|
end
|
26
29
|
end
|
27
30
|
inventory
|
28
31
|
end
|
32
|
+
# rubocop:enable Metrics/MethodLength
|
33
|
+
# rubocop:enable Metrics/AbcSize
|
29
34
|
|
30
35
|
# Create a new inventory
|
31
36
|
def _docker_container_list_new_inventory
|
@@ -6,8 +6,6 @@ module DockerContainerLogin
|
|
6
6
|
def docker_container_login
|
7
7
|
log.debug 'Logging in to docker container'
|
8
8
|
|
9
|
-
return false unless docker_check_daemon
|
10
|
-
|
11
9
|
if _docker_container_lib_check_matrjoschka
|
12
10
|
log.error 'You cannot log in to takelage from within takelage'
|
13
11
|
return false
|
@@ -6,8 +6,6 @@ module DockerContainerPrune
|
|
6
6
|
def docker_container_prune
|
7
7
|
log.debug 'Removing orphaned docker containers'
|
8
8
|
|
9
|
-
return false unless docker_check_daemon
|
10
|
-
|
11
9
|
networks = _docker_container_prune_kill_orphaned_containers
|
12
10
|
_docker_container_lib_remove_networks networks
|
13
11
|
end
|
data/lib/takeltau/init/lib.rb
CHANGED
@@ -6,7 +6,7 @@ module InitLib
|
|
6
6
|
|
7
7
|
# Check git.
|
8
8
|
def _init_lib_git_check
|
9
|
-
return false unless command_available_else_error? config.active['
|
9
|
+
return false unless command_available_else_error? config.active['cmd_git_check']
|
10
10
|
return true unless git_check_workspace
|
11
11
|
|
12
12
|
log.error 'git is already initialized!'
|
data/lib/takeltau/lib/config.rb
CHANGED
@@ -19,7 +19,7 @@ module ConfigModule
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
#
|
22
|
+
# Initialize config
|
23
23
|
# rubocop:disable Metrics/AbcSize
|
24
24
|
def initialize_config
|
25
25
|
project_root_dir = _get_project_root_dir
|
@@ -136,34 +136,27 @@ module ConfigModule
|
|
136
136
|
|
137
137
|
# Get project root directory.
|
138
138
|
# @return [String] project root directory
|
139
|
+
# rubocop:disable Metrics/MethodLength
|
139
140
|
def _get_project_root_dir
|
140
|
-
|
141
|
-
|
142
|
-
|
141
|
+
if ENV.key? 'TAKELAGE_TAU_DIR'
|
142
|
+
log.debug "TAKELTAU_TAU_DIR is set to \"#{ENV['TAKELAGE_TAU_DIR']}\""
|
143
|
+
return ENV['TAKELAGE_TAU_DIR']
|
144
|
+
end
|
143
145
|
|
144
146
|
tau_takelage_root_dir = _get_takelage_root_dir
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
takelship_root_dir = _get_takelship_root_dir
|
150
|
-
return takelship_root_dir unless takelship_root_dir.nil?
|
147
|
+
unless tau_takelage_root_dir.nil?
|
148
|
+
log.debug "Rakefile found in \"#{tau_takelage_root_dir}\""
|
149
|
+
return tau_takelage_root_dir
|
150
|
+
end
|
151
151
|
|
152
|
-
log.debug
|
153
|
-
|
152
|
+
log.debug "Setting root dir to current working dir \"#{Dir.pwd}\""
|
153
|
+
Dir.pwd
|
154
154
|
end
|
155
|
+
# rubocop:enable Metrics/MethodLength
|
155
156
|
|
156
157
|
# Return a takelage root dir
|
157
158
|
def _get_takelage_root_dir
|
158
159
|
_rakefile, path_rakefile = Rake.application.find_rakefile_location
|
159
160
|
path_rakefile
|
160
161
|
end
|
161
|
-
|
162
|
-
# Return a takelship root dir
|
163
|
-
def _get_takelship_root_dir
|
164
|
-
return nil if ENV['TAKELAGE_TAU_SHIP'].nil?
|
165
|
-
|
166
|
-
log.debug 'Invoked in takelship mode. Using current working directory as root directory.'
|
167
|
-
Dir.pwd
|
168
|
-
end
|
169
162
|
end
|
data/lib/takeltau/lib/project.rb
CHANGED
data/lib/takeltau/lib/system.rb
CHANGED
@@ -18,17 +18,6 @@ module SystemModule
|
|
18
18
|
command_available command
|
19
19
|
end
|
20
20
|
|
21
|
-
# Check if a command is available else log warning message
|
22
|
-
# @return [Boolean] is the command available?
|
23
|
-
def command_available_else_warn?(command)
|
24
|
-
unless _command_available? command
|
25
|
-
log.warn "The command \"#{command}\" is not available"
|
26
|
-
return false
|
27
|
-
end
|
28
|
-
|
29
|
-
command_available command
|
30
|
-
end
|
31
|
-
|
32
21
|
# Convert hash to yaml.
|
33
22
|
# @return [String] yaml of hash
|
34
23
|
def hash_to_yaml(hash)
|
@@ -86,7 +75,7 @@ module SystemModule
|
|
86
75
|
# @return [[String, String, Integer]] array of
|
87
76
|
# stdout, stderr, exitstatus of command
|
88
77
|
def run_and_capture(command)
|
89
|
-
log.debug "Running
|
78
|
+
log.debug "Running and capturing command \"#{command}\""
|
90
79
|
stdout_str, stderr_str, status = Open3.capture3 command
|
91
80
|
log.debug "Command \"#{command}\" has stdout:\n\"\"\"\n#{stdout_str}\"\"\""
|
92
81
|
log.debug "Command \"#{command}\" has stderr:\n\"\"\"\n#{stderr_str}\"\"\""
|
@@ -123,20 +112,39 @@ module SystemModule
|
|
123
112
|
private
|
124
113
|
|
125
114
|
# Check if command is available
|
115
|
+
# rubocop:disable Metrics/MethodLength
|
126
116
|
def _command_available?(command)
|
127
|
-
return true if
|
117
|
+
return true if _command_already_checked command
|
128
118
|
|
129
119
|
log.debug "Check if the command \"#{command}\" is available"
|
130
|
-
|
131
|
-
|
132
|
-
|
120
|
+
begin
|
121
|
+
status = try command
|
122
|
+
return false unless status.exitstatus.zero?
|
123
|
+
rescue Errno::ENOENT => e
|
124
|
+
log.debug 'The command failed with an error.'
|
125
|
+
log.debug "Class of error: #{e.class}"
|
126
|
+
log.debug "Error message: #{e.message}"
|
127
|
+
return false
|
128
|
+
end
|
133
129
|
true
|
134
130
|
end
|
131
|
+
# rubocop:enable Metrics/MethodLength
|
132
|
+
|
133
|
+
# Check if command has already been checked
|
134
|
+
def _command_already_checked(command)
|
135
|
+
digest = Digest::SHA256.bubblebabble command
|
136
|
+
command_hash = digest[0..4]
|
137
|
+
return true if instance_variable_get("@command_available_#{command_hash}")
|
138
|
+
|
139
|
+
false
|
140
|
+
end
|
135
141
|
|
136
142
|
# Command is available
|
137
143
|
def command_available(command)
|
138
144
|
log.debug "The command \"#{command}\" is available"
|
139
|
-
|
145
|
+
digest = Digest::SHA256.bubblebabble command
|
146
|
+
command_hash = digest[0..4]
|
147
|
+
instance_variable_set("@command_available_#{command_hash}", true)
|
140
148
|
end
|
141
149
|
|
142
150
|
# Check if file exists.
|
@@ -7,13 +7,11 @@ module MutagenCheckDaemon
|
|
7
7
|
# rubocop:disable Metrics/MethodLength
|
8
8
|
# rubocop:disable Metrics/AbcSize
|
9
9
|
def mutagen_check_daemon
|
10
|
-
return true if @mutagen_daemon_available
|
11
|
-
|
12
10
|
log.debug 'Check mutagen status'
|
13
11
|
|
14
|
-
return false unless command_available_else_error? config.active['
|
12
|
+
return false unless command_available_else_error? config.active['cmd_mutagen_check']
|
15
13
|
|
16
|
-
#
|
14
|
+
# Are we inside a takelage container?
|
17
15
|
unless _docker_container_lib_check_matrjoschka
|
18
16
|
unless _file_exists? config.active['mutagen_socket_path_mutagen_host']
|
19
17
|
log.error 'The mutagen socket path on the host is not available'
|
@@ -21,7 +19,6 @@ module MutagenCheckDaemon
|
|
21
19
|
end
|
22
20
|
|
23
21
|
log.debug 'The mutagen daemon is available'
|
24
|
-
@mutagen_daemon_available = true
|
25
22
|
return true
|
26
23
|
end
|
27
24
|
|
@@ -36,7 +33,6 @@ module MutagenCheckDaemon
|
|
36
33
|
end
|
37
34
|
|
38
35
|
log.debug 'The mutagen daemon is available'
|
39
|
-
@mutagen_daemon_available = true
|
40
36
|
true
|
41
37
|
end
|
42
38
|
# rubocop:enable Metrics/AbcSize
|
data/lib/takeltau/mutagen/cli.rb
CHANGED
@@ -3,6 +3,24 @@
|
|
3
3
|
module Takeltau
|
4
4
|
# tau mutagen
|
5
5
|
class Mutagen < SubCommandBase
|
6
|
+
include LoggingModule
|
7
|
+
include SystemModule
|
8
|
+
include ConfigModule
|
9
|
+
include DockerCheckDaemon
|
10
|
+
include DockerContainerLib
|
11
|
+
include MutagenCheckDaemon
|
12
|
+
|
13
|
+
def initialize(args = [], local_options = {}, configuration = {})
|
14
|
+
# initialize thor parent class
|
15
|
+
super args, local_options, configuration
|
16
|
+
|
17
|
+
log.debug 'Check docker dameon for mutagen subcommand'
|
18
|
+
exit false unless docker_check_daemon
|
19
|
+
|
20
|
+
log.debug 'Check mutagen dameon for mutagen subcommand'
|
21
|
+
exit false unless mutagen_check_daemon
|
22
|
+
end
|
23
|
+
|
6
24
|
desc 'check [COMMAND]', 'Check mutagen'
|
7
25
|
subcommand 'check', MutagenCheck
|
8
26
|
|
@@ -62,6 +62,23 @@ module Takeltau
|
|
62
62
|
true
|
63
63
|
end
|
64
64
|
|
65
|
+
#
|
66
|
+
# config envvars
|
67
|
+
#
|
68
|
+
desc 'envvars', 'Print envvars takeltau configuration'
|
69
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
70
|
+
Print envvars takeltau configuration
|
71
|
+
This command will print the configuration
|
72
|
+
read from environment variables
|
73
|
+
LONGDESC
|
74
|
+
# Print envvars takeltau configuration.
|
75
|
+
def envvars
|
76
|
+
config_envvars_yaml = hash_to_yaml(config.envvars)
|
77
|
+
exit false if config_envvars_yaml == false
|
78
|
+
say config_envvars_yaml
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
65
82
|
#
|
66
83
|
# config active
|
67
84
|
#
|
data/lib/takeltau/ship/cli.rb
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
module Takeltau
|
4
4
|
# tau ship
|
5
5
|
class Ship < SubCommandBase
|
6
|
+
include LoggingModule
|
7
|
+
include SystemModule
|
8
|
+
include ConfigModule
|
9
|
+
include DockerCheckDaemon
|
10
|
+
|
11
|
+
def initialize(args = [], local_options = {}, configuration = {})
|
12
|
+
# initialize thor parent class
|
13
|
+
super args, local_options, configuration
|
14
|
+
|
15
|
+
log.debug 'Check docker dameon for ship subcommand'
|
16
|
+
exit false unless docker_check_daemon 'cmd_ship_docker', 'cmd_ship_docker_check'
|
17
|
+
end
|
18
|
+
|
6
19
|
desc 'completion [COMMAND] ', 'Print shell completion code'
|
7
20
|
subcommand 'completion', ShipCompletion
|
8
21
|
|
@@ -19,12 +32,6 @@ module Takeltau
|
|
19
32
|
# Top-level ship commands
|
20
33
|
#
|
21
34
|
|
22
|
-
desc 'config', 'Alias for tau self config active'
|
23
|
-
# tau config: {Takeltau::SelfConfig#active}
|
24
|
-
def config
|
25
|
-
Takeltau::SelfConfig.new.active
|
26
|
-
end
|
27
|
-
|
28
35
|
desc 'list', 'Alias for tau ship container list'
|
29
36
|
# ship list: {Takeltau::ShipContainer#list}
|
30
37
|
def list
|
@@ -8,8 +8,6 @@ module ShipContainerCheckExisting
|
|
8
8
|
ship_hostname = _ship_container_lib_ship_hostname
|
9
9
|
log.debug "Checking if takelship \"#{ship_hostname}\" is existing"
|
10
10
|
|
11
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
12
|
-
|
13
11
|
stdout_str = run _ship_container_cmd_check_existing ship_hostname
|
14
12
|
|
15
13
|
if stdout_str.to_s.chomp.empty?
|
@@ -26,9 +24,9 @@ module ShipContainerCheckExisting
|
|
26
24
|
# Format command to check if ship container exists.
|
27
25
|
def _ship_container_cmd_check_existing(ship_hostname)
|
28
26
|
format(
|
29
|
-
config.active['
|
30
|
-
|
31
|
-
|
27
|
+
config.active['cmd_docker_container_check_existing_docker_ps'],
|
28
|
+
docker: config.active['cmd_ship_docker'],
|
29
|
+
container: ship_hostname
|
32
30
|
)
|
33
31
|
end
|
34
32
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# tau ship container clean
|
4
|
+
module ShipContainerClean
|
5
|
+
# Remove all takelship containers
|
6
|
+
def ship_container_clean
|
7
|
+
_ship_container_clean_remove_containers
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# Remove all takelship containers
|
13
|
+
# rubocop:disable Metrics/MethodLength
|
14
|
+
def _ship_container_clean_remove_containers
|
15
|
+
ship_name = config.active['ship_name']
|
16
|
+
log.debug "Getting all #{ship_name} containers"
|
17
|
+
|
18
|
+
cmd_docker_get = format(
|
19
|
+
config.active['cmd_docker_container_get_containers'],
|
20
|
+
docker: config.active['cmd_docker'],
|
21
|
+
docker_repo: ship_name
|
22
|
+
)
|
23
|
+
|
24
|
+
containers = (run cmd_docker_get).split(/\n+/)
|
25
|
+
containers.each do |container|
|
26
|
+
_ship_container_lib_remove_container container
|
27
|
+
end
|
28
|
+
end
|
29
|
+
# rubocop:enable Metrics/MethodLength
|
30
|
+
end
|
@@ -6,27 +6,40 @@ module Takeltau
|
|
6
6
|
include LoggingModule
|
7
7
|
include SystemModule
|
8
8
|
include ConfigModule
|
9
|
-
include DockerCheckDaemon
|
10
9
|
include DockerContainerLib
|
11
10
|
include ShipInfoLib
|
12
11
|
include ShipContainerCheckExisting
|
13
12
|
include ShipContainerLib
|
13
|
+
include ShipContainerClean
|
14
14
|
include ShipContainerList
|
15
15
|
include ShipContainerLogin
|
16
16
|
include ShipContainerPodman
|
17
|
+
include ShipContainerStop
|
17
18
|
include ShipContainerUpdate
|
18
19
|
|
19
20
|
desc 'check [COMMAND]', 'Check takelship container'
|
20
21
|
subcommand 'check', ShipContainerCheck
|
21
22
|
|
23
|
+
#
|
24
|
+
# ship container clean
|
25
|
+
#
|
26
|
+
desc 'clean', 'Stop all takelship containers'
|
27
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
28
|
+
Stop all takelship containers
|
29
|
+
LONGDESC
|
30
|
+
# Stop all takelship containers.
|
31
|
+
def clean
|
32
|
+
ship_container_clean
|
33
|
+
end
|
34
|
+
|
22
35
|
#
|
23
36
|
# ship container list
|
24
37
|
#
|
25
|
-
desc 'list', '
|
38
|
+
desc 'list', 'List takelship containers'
|
26
39
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
27
|
-
|
40
|
+
List takelage containers
|
28
41
|
LONGDESC
|
29
|
-
#
|
42
|
+
# List takelage containers.
|
30
43
|
def list
|
31
44
|
say ship_container_list
|
32
45
|
end
|
@@ -55,6 +68,18 @@ module Takeltau
|
|
55
68
|
say ship_container_podman args
|
56
69
|
end
|
57
70
|
|
71
|
+
#
|
72
|
+
# ship container stop
|
73
|
+
#
|
74
|
+
desc 'stop', 'Stop takelship container'
|
75
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
76
|
+
Stop takelship container
|
77
|
+
LONGDESC
|
78
|
+
# Stop takelship container.
|
79
|
+
def stop
|
80
|
+
ship_container_stop
|
81
|
+
end
|
82
|
+
|
58
83
|
#
|
59
84
|
# ship container update
|
60
85
|
#
|
@@ -6,8 +6,6 @@ module ShipContainerLib
|
|
6
6
|
|
7
7
|
# Run nonprivileged docker command
|
8
8
|
def _ship_container_lib_docker_nonprivileged(command)
|
9
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
10
|
-
|
11
9
|
cmd_docker_run_command = format(
|
12
10
|
config.active['cmd_ship_project_start_docker_run_nonprivileged'],
|
13
11
|
ship_docker: config.active['cmd_ship_docker'],
|
@@ -21,8 +19,6 @@ module ShipContainerLib
|
|
21
19
|
# rubocop:disable Metrics/AbcSize
|
22
20
|
# rubocop:disable Metrics/MethodLength
|
23
21
|
def _ship_container_lib_docker_privileged(ports, command)
|
24
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
25
|
-
|
26
22
|
ship_data_dir = config.active['ship_data_dir']
|
27
23
|
ship_env = config.active['ship_env']
|
28
24
|
ports = _ship_container_lib_publish(ports)
|
@@ -45,8 +41,6 @@ module ShipContainerLib
|
|
45
41
|
|
46
42
|
# Run a docker command in a takelship container
|
47
43
|
def _ship_container_lib_docker(command, tty = '--tty')
|
48
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
49
|
-
|
50
44
|
cmd_docker_run_command = format(
|
51
45
|
config.active['cmd_ship_container_docker'],
|
52
46
|
ship_docker: config.active['cmd_ship_docker'],
|
@@ -57,20 +51,6 @@ module ShipContainerLib
|
|
57
51
|
run_and_exit cmd_docker_run_command
|
58
52
|
end
|
59
53
|
|
60
|
-
# Run takelship docker stop command
|
61
|
-
def _ship_container_lib_docker_stop
|
62
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
63
|
-
|
64
|
-
return false unless ship_container_check_existing
|
65
|
-
|
66
|
-
cmd_docker_stop_command = format(
|
67
|
-
config.active['cmd_ship_project_start_docker_stop'],
|
68
|
-
ship_docker: config.active['cmd_ship_docker'],
|
69
|
-
ship_hostname: _ship_container_lib_ship_hostname
|
70
|
-
)
|
71
|
-
run cmd_docker_stop_command
|
72
|
-
end
|
73
|
-
|
74
54
|
# Return takelship image
|
75
55
|
def _ship_container_lib_image
|
76
56
|
ship_user = config.active['ship_user']
|
@@ -133,4 +113,15 @@ module ShipContainerLib
|
|
133
113
|
|
134
114
|
run cmd_get_mounted_dir
|
135
115
|
end
|
116
|
+
|
117
|
+
# Remove takelship container
|
118
|
+
def _ship_container_lib_remove_container(container)
|
119
|
+
cmd_docker_remove_container = format(
|
120
|
+
config.active['cmd_docker_container_stop_container'],
|
121
|
+
docker: config.active['cmd_docker'],
|
122
|
+
container: container
|
123
|
+
)
|
124
|
+
|
125
|
+
run cmd_docker_remove_container
|
126
|
+
end
|
136
127
|
end
|
@@ -6,8 +6,6 @@ module ShipContainerList
|
|
6
6
|
def ship_container_list
|
7
7
|
log.debug 'List takelship containers'
|
8
8
|
|
9
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
10
|
-
|
11
9
|
_ship_container_list_get_inventory.to_yaml
|
12
10
|
end
|
13
11
|
|
@@ -16,10 +14,12 @@ module ShipContainerList
|
|
16
14
|
# Get the current inventory
|
17
15
|
def _ship_container_list_get_inventory
|
18
16
|
ship_name = config.active['ship_name']
|
17
|
+
destination = '/home/podman/takelship'
|
18
|
+
ship_docker = config.active['cmd_ship_docker']
|
19
19
|
inventory = _ship_container_list_new_inventory ship_name
|
20
20
|
_ship_container_lib_get_containers.each do |container|
|
21
|
-
name = _docker_container_lib_get_container_name_by_id container
|
22
|
-
dir =
|
21
|
+
name = (_docker_container_lib_get_container_name_by_id container).strip
|
22
|
+
dir = _docker_container_lib_get_mounted_dir name, destination, ship_docker
|
23
23
|
inventory[ship_name]['hosts'] << { name => dir }
|
24
24
|
end
|
25
25
|
inventory
|
@@ -4,8 +4,6 @@
|
|
4
4
|
module ShipContainerLogin
|
5
5
|
# Run a login command in a takelship
|
6
6
|
def ship_container_login
|
7
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
8
|
-
|
9
7
|
return false unless ship_container_check_existing
|
10
8
|
|
11
9
|
command_after_login = config.active['cmd_ship_container_login']
|
@@ -4,8 +4,6 @@
|
|
4
4
|
module ShipContainerPodman
|
5
5
|
# Run a podman command in a takelship
|
6
6
|
def ship_container_podman(args)
|
7
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
8
|
-
|
9
7
|
return false unless ship_container_check_existing
|
10
8
|
|
11
9
|
_ship_container_lib_docker "pod podman #{args.join(' ')}"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# tau ship container stop
|
4
|
+
module ShipContainerStop
|
5
|
+
# Stop a takelship container
|
6
|
+
def ship_container_stop
|
7
|
+
_ship_container_stop_docker_stop
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# Run takelship docker stop command
|
13
|
+
def _ship_container_stop_docker_stop
|
14
|
+
return false unless ship_container_check_existing
|
15
|
+
|
16
|
+
cmd_docker_stop_command = format(
|
17
|
+
config.active['cmd_ship_project_start_docker_stop'],
|
18
|
+
ship_docker: config.active['cmd_ship_docker'],
|
19
|
+
ship_hostname: _ship_container_lib_ship_hostname
|
20
|
+
)
|
21
|
+
run cmd_docker_stop_command
|
22
|
+
end
|
23
|
+
end
|
@@ -10,6 +10,7 @@ module Takeltau
|
|
10
10
|
include DockerContainerLib
|
11
11
|
include ShipContainerCheckExisting
|
12
12
|
include ShipContainerLib
|
13
|
+
include ShipContainerStop
|
13
14
|
include ShipInfoLib
|
14
15
|
include ShipProjectList
|
15
16
|
include ShipProjectStart
|
@@ -47,7 +48,7 @@ module Takeltau
|
|
47
48
|
LONGDESC
|
48
49
|
# Stop a takelship container.
|
49
50
|
def stop
|
50
|
-
say
|
51
|
+
say ship_container_stop
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|
@@ -4,13 +4,14 @@
|
|
4
4
|
module ShipProjectStart
|
5
5
|
# Start a takelship
|
6
6
|
def ship_project_start(project)
|
7
|
-
return false unless docker_check_daemon 'cmd_ship_docker'
|
8
|
-
|
9
7
|
return false if _docker_container_lib_check_matrjoschka
|
10
8
|
|
11
9
|
return false if ship_container_check_existing
|
12
10
|
|
13
11
|
takelship = _ship_info_lib_get_takelshipinfo
|
12
|
+
|
13
|
+
return false unless takelship.key? 'default_project'
|
14
|
+
|
14
15
|
project = config.active['ship_default_project'] if project == 'default'
|
15
16
|
project = takelship['default_project'] if project == 'default'
|
16
17
|
|
@@ -25,6 +26,7 @@ module ShipProjectStart
|
|
25
26
|
|
26
27
|
# Get takelship ports
|
27
28
|
# rubocop:disable Metrics/MethodLength
|
29
|
+
# rubocop:disable Metrics/AbcSize
|
28
30
|
def _ship_project_start_ports(takelship, project)
|
29
31
|
ports = []
|
30
32
|
takelship['projects'].each do |takelship_project|
|
@@ -38,9 +40,12 @@ module ShipProjectStart
|
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
41
|
-
|
42
|
-
|
43
|
+
if config.active['ship_port_expose_podman_socket'] == 'true'
|
44
|
+
log.debug "Add DOCKER_HOST port #{config.active['ship_docker_host']}"
|
45
|
+
ports << config.active['ship_docker_host']
|
46
|
+
end
|
43
47
|
ports
|
44
48
|
end
|
45
49
|
end
|
50
|
+
# rubocop:enable Metrics/AbcSize
|
46
51
|
# rubocop:enable Metrics/MethodLength
|
data/lib/takeltau/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.43.
|
1
|
+
0.43.19
|
data/lib/takeltau.rb
CHANGED
@@ -89,8 +89,10 @@ require_relative 'takeltau/ship/container/check/existing'
|
|
89
89
|
require_relative 'takeltau/ship/container/check/cli'
|
90
90
|
require_relative 'takeltau/ship/info/lib'
|
91
91
|
require_relative 'takeltau/ship/container/list'
|
92
|
+
require_relative 'takeltau/ship/container/clean'
|
92
93
|
require_relative 'takeltau/ship/container/login'
|
93
94
|
require_relative 'takeltau/ship/container/podman'
|
95
|
+
require_relative 'takeltau/ship/container/stop'
|
94
96
|
require_relative 'takeltau/ship/container/update'
|
95
97
|
require_relative 'takeltau/ship/container/cli'
|
96
98
|
require_relative 'takeltau/ship/info/cli'
|
@@ -136,12 +138,6 @@ module Takeltau
|
|
136
138
|
# Initialize global singleton project
|
137
139
|
initialize_project
|
138
140
|
|
139
|
-
# Set defaults
|
140
|
-
@docker_daemon_running = false
|
141
|
-
@command_available_docker = false
|
142
|
-
@mutagen_daemon_available = false
|
143
|
-
@command_available_mutagen = false
|
144
|
-
|
145
141
|
# fylla bash completion code
|
146
142
|
@bash_fylla = Fylla.bash_completion self
|
147
143
|
end
|
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.43.
|
4
|
+
version: 0.43.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takelwerk
|
@@ -288,11 +288,13 @@ files:
|
|
288
288
|
- lib/takeltau/ship/completion/cli.rb
|
289
289
|
- lib/takeltau/ship/container/check/cli.rb
|
290
290
|
- lib/takeltau/ship/container/check/existing.rb
|
291
|
+
- lib/takeltau/ship/container/clean.rb
|
291
292
|
- lib/takeltau/ship/container/cli.rb
|
292
293
|
- lib/takeltau/ship/container/lib.rb
|
293
294
|
- lib/takeltau/ship/container/list.rb
|
294
295
|
- lib/takeltau/ship/container/login.rb
|
295
296
|
- lib/takeltau/ship/container/podman.rb
|
297
|
+
- lib/takeltau/ship/container/stop.rb
|
296
298
|
- lib/takeltau/ship/container/update.rb
|
297
299
|
- lib/takeltau/ship/info/cli.rb
|
298
300
|
- lib/takeltau/ship/info/lib.rb
|