takeltau 0.37.3 → 0.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/takeltau/default.yml +1 -0
- data/lib/takeltau/docker/container/lib.rb +0 -3
- data/lib/takeltau/info/status/bar.rb +25 -10
- data/lib/takeltau/info/status/cli.rb +14 -1
- data/lib/takeltau/info/status/hg.rb +26 -0
- data/lib/takeltau/info/status/lib.rb +14 -0
- data/lib/takeltau/self/commands.rb +1 -1
- data/lib/takeltau/version +1 -1
- data/lib/takeltau.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73f3cdc1423e876043ceea53b0e7209589e7b5474ad44b1213cbffa6336ad7af
|
4
|
+
data.tar.gz: 83a3dfa517ac84b8265a09b64b325184473fd0a22bf98fd241f4713e7e59c0ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 923b34a21ed9d509f88be302e3c4e8682adae221d60f59a6a092ba706501ed5de13125a0184e0d7d26130441aeb84c015be119ec9e5a313a4078c11bf17de7e0
|
7
|
+
data.tar.gz: 83eec4fbdd1c53604dce8d1d53fab8d3c94678f997611f294afd6d833dcabcf78315337e427af44234f2562d8c4006d76eb585cdd2ff09afbeef8077d44b168a
|
data/README.md
CHANGED
@@ -95,24 +95,26 @@ tau [info status bar](features/cucumber/features/info/info.status.bar.feature) |
|
|
95
95
|
tau [info status git](features/cucumber/features/info/info.status.git.feature) | Check git status
|
96
96
|
tau [info status gopass](features/cucumber/features/info/info.status.gopass.feature) | Check gopass status
|
97
97
|
tau [info status gpg](features/cucumber/features/info/info.status.gpg.feature) | Check gpg status
|
98
|
+
tau [info status hg](features/cucumber/features/info/info.status.hg.feature) | Check hg status
|
98
99
|
tau [info status mutagen](features/cucumber/features/info/info.status.mutagen.feature) | Check mutagen status
|
99
100
|
tau [info status ssh](features/cucumber/features/info/info.status.ssh.feature) | Check ssh status
|
100
|
-
tau [init packer docker](features/cucumber/features/
|
101
|
+
tau [init packer docker](features/cucumber/features/init/init.packer.docker.feature) | Initialize packer project for docker images
|
102
|
+
tau [init takelage rake](features/cucumber/features/init/init.takelage.rake.feature) | Initialize takelage rake project
|
101
103
|
tau [mutagen check daemon](features/cucumber/features/mutagen/mutagen.check.daemon.feature)) | Check if mutagen host conenction is available
|
102
104
|
tau [mutagen socket check](features/cucumber/features/mutagen/mutagen.socket.check.feature) [SOCKET] | Check if mutagen [SOCKET] exists
|
103
105
|
tau [mutagen socket create](features/cucumber/features/mutagen/mutagen.socket.create.feature) [NAME] [IN] [OUT] | Create a mutagen socket [NAME] from [IN] to [OUT] of the container
|
104
106
|
tau [mutagen socket list](features/cucumber/features/mutagen/mutagen.socket.list.feature) | List mutagen sockets
|
105
|
-
tau [mutagen socket tidy](features/cucumber/features/mutagen/mutagen.socket.tidy.feature) | Remove mutagen daemon files
|
106
107
|
tau [mutagen socket terminate](features/cucumber/features/mutagen/mutagen.socket.terminate.feature) [SOCKET] | Terminate a mutagen [SOCKET]
|
108
|
+
tau [mutagen socket tidy](features/cucumber/features/mutagen/mutagen.socket.tidy.feature) | Remove mutagen daemon files
|
109
|
+
tau [self commands](features/cucumber/features/self/self.commands.feature) | List all commands
|
107
110
|
tau [self config active](features/cucumber/features/self/self.config.active.feature) | Print active takelage configuration
|
108
111
|
tau [self config default](features/cucumber/features/self/self.config.default.feature) | Print takelage default configuration
|
109
112
|
tau [self config home](features/cucumber/features/self/self.config.home.feature) | Print takelage home config file configuration
|
110
113
|
tau [self config project](features/cucumber/features/self/self.config.project.feature) | Print takelage project config file configuration
|
111
|
-
tau [self commands](features/cucumber/features/self/self.commands.feature) | List all commands
|
112
114
|
tau [self version](features/cucumber/features/self/self.version.feature) | Print tau semantic version number
|
113
115
|
tau clean | Alias for tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature)
|
114
|
-
tau config | Alias for tau [self config active](features/cucumber/features/self/self.config.active.feature)
|
115
116
|
tau commands | Alias for tau [self commands](features/cucumber/features/self/self.commands.feature)
|
117
|
+
tau config | Alias for tau [self config active](features/cucumber/features/self/self.config.active.feature)
|
116
118
|
tau login | Alias for tau [docker container login](features/cucumber/features/docker/docker.container.login.feature)
|
117
119
|
tau project | Alias for tau [info project active](features/cucumber/features/info/info.project.active.feature)
|
118
120
|
tau prune | Alias for tau [docker container prune](features/cucumber/features/docker/docker.container.prune.feature)
|
data/lib/takeltau/default.yml
CHANGED
@@ -37,6 +37,7 @@ cmd_info_status_lib_git_key_available: 'gpg --list-key %{key}'
|
|
37
37
|
cmd_info_status_gopass_root_store: 'gopass config | grep "path" | cut -d " " -f 2'
|
38
38
|
cmd_info_status_gpg_agent: 'gpg-connect-agent /bye'
|
39
39
|
cmd_info_status_gpg_keys: 'gpg --list-keys'
|
40
|
+
cmd_info_status_hg_username: 'hg config ui.username'
|
40
41
|
cmd_info_status_ssh_keys: 'ssh-add -l'
|
41
42
|
cmd_info_status_ssh_socket: 'gpgconf --list-dirs agent-ssh-socket'
|
42
43
|
cmd_init_lib_git_init: 'git init && git checkout -b main'
|
@@ -122,7 +122,6 @@ module DockerContainerLib
|
|
122
122
|
end
|
123
123
|
|
124
124
|
log.debug 'We are inside a takelage container'
|
125
|
-
|
126
125
|
true
|
127
126
|
end
|
128
127
|
|
@@ -145,9 +144,7 @@ module DockerContainerLib
|
|
145
144
|
)
|
146
145
|
|
147
146
|
name = (run cmd_get_container_name_by_id).chomp
|
148
|
-
|
149
147
|
log.debug "Container #{container} has name \"#{name}\""
|
150
|
-
|
151
148
|
name
|
152
149
|
end
|
153
150
|
|
@@ -9,18 +9,19 @@ module InfoStatusBar
|
|
9
9
|
log.debug 'Get status info bar'
|
10
10
|
|
11
11
|
@bar_list = []
|
12
|
+
@bar_status = true
|
12
13
|
|
13
14
|
_info_status_bar_takelage
|
14
15
|
_info_status_bar_tau
|
15
16
|
_info_status_bar_git
|
16
17
|
_info_status_bar_gopass
|
17
18
|
_info_status_bar_gpg
|
19
|
+
_info_status_bar_hg
|
18
20
|
_info_status_bar_mutagen
|
19
21
|
_info_status_bar_ssh
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
bar
|
23
|
+
say @bar_list.join(' | ')
|
24
|
+
@bar_status
|
24
25
|
end
|
25
26
|
# rubocop:enable Metrics/MethodLength
|
26
27
|
|
@@ -28,11 +29,10 @@ module InfoStatusBar
|
|
28
29
|
|
29
30
|
# Add takelage version info to bar.
|
30
31
|
def _info_status_bar_takelage
|
31
|
-
|
32
|
-
return unless
|
32
|
+
# Check if we are inside a takelage docker container
|
33
|
+
return unless _docker_container_lib_check_matrjoschka
|
33
34
|
|
34
|
-
|
35
|
-
@bar_list << "#{config.active['docker_repo']}: #{@content_file.chomp.green}"
|
35
|
+
@bar_list << _info_status_lib_get_channel_and_version
|
36
36
|
end
|
37
37
|
|
38
38
|
# Add tau version info to bar.
|
@@ -43,12 +43,14 @@ module InfoStatusBar
|
|
43
43
|
# Add git status info to bar.
|
44
44
|
def _info_status_bar_git
|
45
45
|
@status_git = info_status_git
|
46
|
+
@bar_status &&= @status_git
|
46
47
|
@bar_list << ("git: #{@status_git ? 'ok'.green : 'no'.red}")
|
47
48
|
end
|
48
49
|
|
49
50
|
# Add gopass status info to bar.
|
50
51
|
def _info_status_bar_gopass
|
51
52
|
@status_gopass = info_status_gopass
|
53
|
+
@bar_status &&= @status_gopass
|
52
54
|
@bar_list << ("gopass: #{@status_gopass ? 'ok'.green : 'no'.red}")
|
53
55
|
end
|
54
56
|
|
@@ -59,17 +61,30 @@ module InfoStatusBar
|
|
59
61
|
return
|
60
62
|
end
|
61
63
|
|
62
|
-
|
64
|
+
status_gpg = info_status_gpg
|
65
|
+
@bar_status &&= status_gpg
|
66
|
+
@bar_list << ("gpg: #{status_gpg ? 'ok'.green : 'no'.red}")
|
67
|
+
end
|
68
|
+
|
69
|
+
# Add git status info to bar.
|
70
|
+
def _info_status_bar_hg
|
71
|
+
@status_hg = info_status_hg
|
72
|
+
@bar_status &&= @status_hg
|
73
|
+
@bar_list << ("hg: #{@status_hg ? 'ok'.green : 'no'.red}")
|
63
74
|
end
|
64
75
|
|
65
76
|
# Add mutagen status info to bar.
|
66
77
|
def _info_status_bar_mutagen
|
67
|
-
|
78
|
+
status_mutagen = mutagen_check_daemon
|
79
|
+
@bar_status &&= status_mutagen
|
80
|
+
@bar_list << ("mutagen: #{status_mutagen ? 'ok'.green : 'no'.red}")
|
68
81
|
end
|
69
82
|
|
70
83
|
# Add ssh status info to bar.
|
71
84
|
def _info_status_bar_ssh
|
72
|
-
|
85
|
+
status_ssh = info_status_ssh
|
86
|
+
@bar_status &&= status_ssh
|
87
|
+
@bar_list << ("ssh: #{status_ssh ? 'ok'.green : 'no'.red}")
|
73
88
|
end
|
74
89
|
end
|
75
90
|
|
@@ -16,6 +16,7 @@ module Takeltau
|
|
16
16
|
include InfoStatusGit
|
17
17
|
include InfoStatusGopass
|
18
18
|
include InfoStatusGPG
|
19
|
+
include InfoStatusHg
|
19
20
|
include InfoStatusSSH
|
20
21
|
include InfoStatusBar
|
21
22
|
include MutagenCheckDaemon
|
@@ -41,7 +42,7 @@ module Takeltau
|
|
41
42
|
LONGDESC
|
42
43
|
# Print status info bar.
|
43
44
|
def bar
|
44
|
-
|
45
|
+
exit info_status_bar
|
45
46
|
end
|
46
47
|
|
47
48
|
#
|
@@ -80,6 +81,18 @@ module Takeltau
|
|
80
81
|
exit info_status_gpg
|
81
82
|
end
|
82
83
|
|
84
|
+
#
|
85
|
+
# info status hg
|
86
|
+
#
|
87
|
+
desc 'hg', 'Check hg status info'
|
88
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
89
|
+
Check hg status info
|
90
|
+
LONGDESC
|
91
|
+
# Check hg status info.
|
92
|
+
def hg
|
93
|
+
exit info_status_hg
|
94
|
+
end
|
95
|
+
|
83
96
|
#
|
84
97
|
# info status mutagen
|
85
98
|
#
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# tau info status hg
|
4
|
+
module InfoStatusHg
|
5
|
+
# Backend method for info status hg.
|
6
|
+
# @return [Boolean] has mercurial been configured?
|
7
|
+
def info_status_hg
|
8
|
+
log.debug 'Check hg status'
|
9
|
+
|
10
|
+
unless _info_status_hg_username
|
11
|
+
log.error 'hg ui.username is not configured'
|
12
|
+
return false
|
13
|
+
end
|
14
|
+
|
15
|
+
log.debug 'hg config is available'
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# Check hg username
|
22
|
+
def _info_status_hg_username
|
23
|
+
status_username = try config.active['cmd_info_status_hg_username']
|
24
|
+
status_username.exitstatus.zero?
|
25
|
+
end
|
26
|
+
end
|
@@ -43,4 +43,18 @@ module InfoStatusLib
|
|
43
43
|
)
|
44
44
|
try cmd_git_key_available
|
45
45
|
end
|
46
|
+
|
47
|
+
# Get takelage environment string
|
48
|
+
def _info_status_lib_get_channel_and_version
|
49
|
+
takelage_version_file = '/etc/takelage_version'
|
50
|
+
return '' unless _file_exists? takelage_version_file
|
51
|
+
|
52
|
+
_file_read takelage_version_file
|
53
|
+
|
54
|
+
channel = config.active['docker_repo']
|
55
|
+
version = @content_file.chomp
|
56
|
+
|
57
|
+
log.debug "#{channel}: #{version.green}"
|
58
|
+
"#{channel}: #{version.green}"
|
59
|
+
end
|
46
60
|
end
|
@@ -27,7 +27,7 @@ module SelfCommands
|
|
27
27
|
# Manipulate output of thor list command.
|
28
28
|
def _manipulate_output_(thor_list)
|
29
29
|
tau_commands = thor_list.gsub("takeltau\n", '')
|
30
|
-
tau_commands.gsub!("
|
30
|
+
tau_commands.gsub!("--------\n", '')
|
31
31
|
tau_commands.gsub!('thor ', 'tau ')
|
32
32
|
tau_commands.gsub!(/(.*)takeltau:c_l_i:(.*)#(.*)/, '\1\2 #\3')
|
33
33
|
tau_commands.gsub!(/.*COMMAND.*\n/, '')
|
data/lib/takeltau/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.39.0
|
data/lib/takeltau.rb
CHANGED
@@ -70,6 +70,7 @@ require_relative 'takeltau/info/status/lib'
|
|
70
70
|
require_relative 'takeltau/info/status/git'
|
71
71
|
require_relative 'takeltau/info/status/gopass'
|
72
72
|
require_relative 'takeltau/info/status/gpg'
|
73
|
+
require_relative 'takeltau/info/status/hg'
|
73
74
|
require_relative 'takeltau/info/status/ssh'
|
74
75
|
require_relative 'takeltau/info/status/bar'
|
75
76
|
require_relative 'takeltau/info/status/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.
|
4
|
+
version: 0.39.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takelwerk
|
@@ -244,6 +244,7 @@ files:
|
|
244
244
|
- lib/takeltau/info/status/git.rb
|
245
245
|
- lib/takeltau/info/status/gopass.rb
|
246
246
|
- lib/takeltau/info/status/gpg.rb
|
247
|
+
- lib/takeltau/info/status/hg.rb
|
247
248
|
- lib/takeltau/info/status/lib.rb
|
248
249
|
- lib/takeltau/info/status/ssh.rb
|
249
250
|
- lib/takeltau/init/cli.rb
|