takeltau 0.43.23 → 0.44.2
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/README.md +42 -9
- data/bin/ship +1 -1
- data/lib/takeltau/docker/container/lib.rb +5 -1
- data/lib/takeltau/init/packer/docker.rb +1 -1
- data/lib/takeltau/init/takelage/rake.rb +1 -1
- data/lib/takeltau/lib/config.rb +24 -6
- data/lib/takeltau/ship/cli.rb +55 -15
- data/lib/takeltau/ship/completion/bash.rb +0 -6
- data/lib/takeltau/ship/completion/cli.rb +2 -3
- data/lib/takeltau/ship/container/check/cli.rb +1 -2
- data/lib/takeltau/ship/container/cli.rb +15 -23
- data/lib/takeltau/ship/info/cli.rb +16 -13
- data/lib/takeltau/ship/project/cli.rb +8 -12
- data/lib/takeltau/version +1 -1
- data/lib/takeltau.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c0fd02dbdf001b8c5fa156dda3652f49e03478e9f8f1815242c309acaf29a4
|
4
|
+
data.tar.gz: 9e729bcd61aff9974a34e7a6f203ac628e99c359ef0eb1756329cd88bbadba17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f258eec6024594a928f0da69b07836b1c0382b40b1c057976aacda403cfa77fa7d25b96bbe6597a92f41b3441902380d7a06f597598946c6673db5ee863fe341
|
7
|
+
data.tar.gz: f9db8ceaeaa94f105b07ecd766ac6b03022bbe04164d358b137e8b7816ff8b5591c3bdcaab14be4e5f98ea0bbb5bb2c84dd711db4177abf30c0b0146f6649d9b
|
data/README.md
CHANGED
@@ -115,6 +115,32 @@ tau [self config default](features/cucumber/features/self/self.config.default.fe
|
|
115
115
|
tau [self config home](features/cucumber/features/self/self.config.home.feature) | Print takelage home config file configuration
|
116
116
|
tau [self config project](features/cucumber/features/self/self.config.project.feature) | Print takelage project config file configuration
|
117
117
|
tau [self version](features/cucumber/features/self/self.version.feature) | Print tau semantic version number
|
118
|
+
tau [ship completion bash](features/cucumber/features/ship/completion/completion.bash.feature) | Print bash completion code for ship subcommand
|
119
|
+
tau [ship container check existing](features/cucumber/features/ship/container/ship.container.check.existing.feature) | Check if a takelship is existing
|
120
|
+
tau [ship container clean](features/cucumber/features/ship/container/ship.container.clean.feature) | Stop all takelships
|
121
|
+
tau [ship container command](features/cucumber/features/ship/container/ship.container.command.feature) [COMMAND] | Run a [COMMAND] in a takelship container
|
122
|
+
tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature) | List takelships
|
123
|
+
tau [ship container login](features/cucumber/features/ship/container/ship.container.login.feature) | Log in to a takelship
|
124
|
+
tau [ship container podman](features/cucumber/features/ship/container/ship.container.podman.feature) [COMMAND] | Run a podman [COMMAND] in a takelship
|
125
|
+
tau [ship container stop](features/cucumber/features/ship/container/ship.container.stop.feature) | Stop a takelship
|
126
|
+
tau [ship container sudo](features/cucumber/features/ship/container/ship.container.sudo.feature) [COMMAND] | Run a sudo [COMMAND] in a takelship
|
127
|
+
tau [ship container update](features/cucumber/features/ship/container/ship.container.update.feature) | Update takelship image
|
128
|
+
tau [ship info takelconfig](features/cucumber/features/ship/info/ship.info.takelconfig.feature) | Print takelage config
|
129
|
+
tau [ship info takelship](features/cucumber/features/ship/info/ship.info.takelship.feature) | Print takelship info
|
130
|
+
tau [ship project list](features/cucumber/features/ship/project/ship.project.list.feature) | List takelship projects
|
131
|
+
tau [ship project logs](features/cucumber/features/ship/project/ship.project.logs.feature) [PROJECT] | Follow logs of a takelship [PROJECT]
|
132
|
+
tau [ship project start](features/cucumber/features/ship/project/ship.project.start.feature) [PROJECT] | Start a takelship [PROJECT]
|
133
|
+
tau [ship project stop](features/cucumber/features/ship/project/ship.project.stop.feature) | Stop a takelship project
|
134
|
+
tau ship command [COMMAND] | Alias for tau [ship container command](features/cucumber/features/ship/container/ship.container.command.feature)
|
135
|
+
tau ship list | Alias for tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature)
|
136
|
+
tau ship login | Alias for tau [ship container login](features/cucumber/features/ship/container/ship.container.login.feature)
|
137
|
+
tau ship logs [PROJECT] | Alias for tau [ship project logs](features/cucumber/features/ship/project/ship.project.logs.feature)
|
138
|
+
tau ship ls | Alias for tau [ship container list](features/cucumber/features/ship/container/ship.container.list.feature)
|
139
|
+
tau ship podman [COMMAND] | Alias for tau [ship container podman](features/cucumber/features/ship/container/ship.container.podman.feature)
|
140
|
+
tau ship start [PROJECT] | Alias for tau [ship project start](features/cucumber/features/ship/project/ship.project.start.feature)
|
141
|
+
tau ship stop | Alias for tau [ship project stop](features/cucumber/features/ship/project/ship.project.stop.feature)
|
142
|
+
tau ship sudo [COMMAND] | Alias for tau [ship container sudo](features/cucumber/features/ship/container/ship.container.sudo.feature)
|
143
|
+
tau ship update | Alias for tau [ship container update](features/cucumber/features/ship/container/ship.container.update.feature)
|
118
144
|
tau clean | Alias for tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature)
|
119
145
|
tau commands | Alias for tau [self commands](features/cucumber/features/self/self.commands.feature)
|
120
146
|
tau config | Alias for tau [self config active](features/cucumber/features/self/self.config.active.feature)
|
@@ -133,21 +159,28 @@ tau version | Alias for tau [self version](features/cucumber/features/self/self.
|
|
133
159
|
|
134
160
|
### Configuration Files
|
135
161
|
|
136
|
-
*takelage-cli* uses three different YAML configuration files
|
137
|
-
which have different precedences.
|
162
|
+
*takelage-cli* uses three different YAML configuration files and environment variables which have different precedences.
|
138
163
|
They are merged to an active configuration during runtime
|
139
164
|
which can be inspected with
|
140
165
|
*tau [self config active](features/cucumber/features/self/self.config.active.feature)*
|
141
166
|
or *tau config*.
|
142
167
|
|
143
168
|
| Filename | Precedence | Description |
|
144
|
-
|
145
|
-
| *default.yml* | lowest | Shipped with *takelage-cli*. Sets defaults where applicable.
|
146
|
-
| *~/.takelage.yml* | normal | User-wide configuration file in your home directory. This is your normal custom configuration file.
|
147
|
-
| *takelage.yml* | highest | Project-specific configuration file next to your main Rakefile. Some projects need special configuration.
|
148
|
-
|
149
|
-
|
150
|
-
|
169
|
+
|-|-|-|
|
170
|
+
| *default.yml* | lowest | Shipped with *takelage-cli*. Sets defaults where applicable. |
|
171
|
+
| *~/.takelage.yml* | normal | User-wide configuration file in your home directory. This is your normal custom configuration file. |
|
172
|
+
| *takelage.yml* | highest | Project-specific configuration file next to your main Rakefile. Some projects need special configuration. |
|
173
|
+
| TAKELAGE_TAU_CONFIG_* | ultimate | Fileless configuration through TAKELAGE_TAU_CONFIG environment variables. |
|
174
|
+
|
175
|
+
The tau command line tool is directory-aware so it is important that you can set the working directory of the tau command.
|
176
|
+
The project directory is identified by the first match:
|
177
|
+
|
178
|
+
| Method | Precedence | Description |
|
179
|
+
|-|-|-|
|
180
|
+
| `--workdir`/`-w` command line option | ultimate |
|
181
|
+
| `TAKELAGE_WORKDIR` environment variable | highest |
|
182
|
+
| Main [`Rakefile`](Rakefile) | normal |
|
183
|
+
| Current working directory | lowest |
|
151
184
|
|
152
185
|
### Configuration Examples
|
153
186
|
|
data/bin/ship
CHANGED
@@ -181,6 +181,10 @@ module DockerContainerLib
|
|
181
181
|
run cmd_docker_stop
|
182
182
|
end
|
183
183
|
|
184
|
+
def _docker_container_lib_homify_dir(dir)
|
185
|
+
dir.strip.sub Dir.home, '~'
|
186
|
+
end
|
187
|
+
|
184
188
|
# Get the mounted takelage directory
|
185
189
|
def _docker_container_lib_get_mounted_dir(name, destination, docker)
|
186
190
|
log.debug 'Getting mounted directory from ' \
|
@@ -193,7 +197,7 @@ module DockerContainerLib
|
|
193
197
|
dest_dir: "\"#{destination}\""
|
194
198
|
)
|
195
199
|
|
196
|
-
|
200
|
+
_docker_container_lib_homify_dir run cmd_get_mounted_dir
|
197
201
|
end
|
198
202
|
end
|
199
203
|
# rubocop:enable Style/IfUnlessModifier
|
data/lib/takeltau/lib/config.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# tau config module
|
4
|
+
# rubocop:disable Metrics/ModuleLength
|
4
5
|
module ConfigModule
|
5
6
|
# tau config class.
|
6
7
|
class TakeltauConfig
|
@@ -21,8 +22,8 @@ module ConfigModule
|
|
21
22
|
|
22
23
|
# Initialize config
|
23
24
|
# rubocop:disable Metrics/AbcSize
|
24
|
-
def initialize_config
|
25
|
-
project_root_dir = _get_project_root_dir
|
25
|
+
def initialize_config(workdir)
|
26
|
+
project_root_dir = _get_project_root_dir workdir
|
26
27
|
|
27
28
|
log.debug "takelage version: #{Takeltau::VERSION}"
|
28
29
|
log.debug "Current working directory: #{Dir.pwd}"
|
@@ -137,10 +138,18 @@ module ConfigModule
|
|
137
138
|
# Get project root directory.
|
138
139
|
# @return [String] project root directory
|
139
140
|
# rubocop:disable Metrics/MethodLength
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
141
|
+
# rubocop:disable Metrics/AbcSize
|
142
|
+
def _get_project_root_dir(workdir)
|
143
|
+
tau_workdir_root_dir = _get_workdir_root_dir workdir
|
144
|
+
unless tau_workdir_root_dir.empty?
|
145
|
+
log.debug "CLI option workdir is set to #{tau_workdir_root_dir}"
|
146
|
+
return tau_workdir_root_dir
|
147
|
+
end
|
148
|
+
|
149
|
+
if ENV.key? 'TAKELAGE_WORKDIR'
|
150
|
+
tau_envvar_root_dir = ENV['TAKELAGE_WORKDIR']
|
151
|
+
log.debug "TAKELAGE_WORKDIR is set to \"#{tau_envvar_root_dir}\""
|
152
|
+
return File.expand_path tau_envvar_root_dir
|
144
153
|
end
|
145
154
|
|
146
155
|
tau_takelage_root_dir = _get_takelage_root_dir
|
@@ -152,11 +161,20 @@ module ConfigModule
|
|
152
161
|
log.debug "Setting root dir to current working dir \"#{Dir.pwd}\""
|
153
162
|
Dir.pwd
|
154
163
|
end
|
164
|
+
# rubocop:enable Metrics/AbcSize
|
155
165
|
# rubocop:enable Metrics/MethodLength
|
156
166
|
|
167
|
+
# Return a command line workdir
|
168
|
+
def _get_workdir_root_dir(workdir)
|
169
|
+
return '' unless Dir.exist? File.expand_path workdir
|
170
|
+
|
171
|
+
workdir
|
172
|
+
end
|
173
|
+
|
157
174
|
# Return a takelage root dir
|
158
175
|
def _get_takelage_root_dir
|
159
176
|
_rakefile, path_rakefile = Rake.application.find_rakefile_location
|
160
177
|
path_rakefile
|
161
178
|
end
|
162
179
|
end
|
180
|
+
# rubocop:enable Metrics/ModuleLength
|
data/lib/takeltau/ship/cli.rb
CHANGED
@@ -32,61 +32,101 @@ module Takeltau
|
|
32
32
|
# Top-level ship commands
|
33
33
|
#
|
34
34
|
|
35
|
-
desc '
|
35
|
+
desc 'command [COMMAND]', 'Run a [COMMAND] in a takelship'
|
36
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
37
|
+
Run a command in a takelship container as user podman.
|
38
|
+
Alias for ship container command.
|
39
|
+
LONGDESC
|
40
|
+
# ship command: {Takeltau::ShipContainer#command}
|
41
|
+
def command(*args)
|
42
|
+
Takeltau::ShipContainer.new.command args
|
43
|
+
end
|
44
|
+
|
45
|
+
desc 'list', 'List takelships'
|
46
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
47
|
+
List takelship containers.
|
48
|
+
Alias for ship container list.
|
49
|
+
LONGDESC
|
36
50
|
# ship list: {Takeltau::ShipContainer#list}
|
37
51
|
def list
|
38
52
|
Takeltau::ShipContainer.new.list
|
39
53
|
end
|
40
54
|
|
41
|
-
desc 'logs [PROJECT]', '
|
55
|
+
desc 'logs [PROJECT]', 'Follow logs of takelship [PROJECT]'
|
56
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
57
|
+
Follow logs of project [PROJECT] in a takelship project.
|
58
|
+
Alias for ship project logs.
|
59
|
+
LONGDESC
|
42
60
|
# ship logs: {Takeltau::ShipProject#logs}
|
43
61
|
def logs(project = 'default')
|
44
62
|
Takeltau::ShipProject.new.logs(project)
|
45
63
|
end
|
46
64
|
|
47
|
-
desc 'ls', '
|
65
|
+
desc 'ls', 'List takelships'
|
66
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
67
|
+
List takelship containers.
|
68
|
+
Alias for ship container list.
|
69
|
+
LONGDESC
|
48
70
|
# ship list: {Takeltau::ShipContainer#list}
|
49
71
|
def ls
|
50
72
|
Takeltau::ShipContainer.new.list
|
51
73
|
end
|
52
74
|
|
53
|
-
desc 'login', '
|
75
|
+
desc 'login', 'Log in to a takelship'
|
76
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
77
|
+
Log in to a takelship as root.
|
78
|
+
Alias for ship container login.
|
79
|
+
LONGDESC
|
54
80
|
# ship login: {Takeltau::ShipContainer#login}
|
55
81
|
def login
|
56
82
|
Takeltau::ShipContainer.new.login
|
57
83
|
end
|
58
84
|
|
59
|
-
desc 'podman [
|
85
|
+
desc 'podman [COMMAND]', 'Run a podman [COMMAND] in a takelship'
|
86
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
87
|
+
Run a podman command as user podman in a takelship container.
|
88
|
+
Alias for ship container podman.
|
89
|
+
LONGDESC
|
60
90
|
# ship podman: {Takeltau::ShipContainer#podman}
|
61
91
|
def podman(*args)
|
62
92
|
Takeltau::ShipContainer.new.podman args
|
63
93
|
end
|
64
94
|
|
65
|
-
desc '
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
desc 'sudo [ARGS]', 'Alias for tau ship container sudo'
|
95
|
+
desc 'sudo [COMMAND]', 'Run a sudo [COMMAND] in a takelship'
|
96
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
97
|
+
Run a command as root in a takelship container.
|
98
|
+
Alias for ship container sudo.
|
99
|
+
LONGDESC
|
72
100
|
# ship sudo: {Takeltau::ShipContainer#sudo}
|
73
101
|
def sudo(*args)
|
74
102
|
Takeltau::ShipContainer.new.sudo args
|
75
103
|
end
|
76
104
|
|
77
|
-
desc 'start [PROJECT]', '
|
105
|
+
desc 'start [PROJECT]', 'Start takelship [PROJECT]'
|
106
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
107
|
+
Start a takelship and run project [PROJECT] in it.
|
108
|
+
Alias for ship project start.
|
109
|
+
LONGDESC
|
78
110
|
# ship start: {Takeltau::ShipProject#start}
|
79
111
|
def start(project = 'default')
|
80
112
|
Takeltau::ShipProject.new.start project
|
81
113
|
end
|
82
114
|
|
83
|
-
desc 'stop', '
|
115
|
+
desc 'stop', 'Stop a takelship'
|
116
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
117
|
+
Stop a takelship container.
|
118
|
+
Alias for ship container stop.
|
119
|
+
LONGDESC
|
84
120
|
# ship stop: {Takeltau::ShipProject#stop}
|
85
121
|
def stop
|
86
122
|
Takeltau::ShipProject.new.stop
|
87
123
|
end
|
88
124
|
|
89
|
-
desc 'update', '
|
125
|
+
desc 'update', 'Update takelship image'
|
126
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
127
|
+
Update the takelship docker image.
|
128
|
+
Alias for ship container update.
|
129
|
+
LONGDESC
|
90
130
|
# tau update: {Takeltau::ShipContainer#update}
|
91
131
|
def update
|
92
132
|
Takeltau::ShipContainer.new.update
|
@@ -14,19 +14,13 @@ module ShipCompletionBash
|
|
14
14
|
private
|
15
15
|
|
16
16
|
# Remove bash completion lines
|
17
|
-
# rubocop:disable Style/BlockDelimiters
|
18
17
|
def _ship_completion_bash_remove_lines(tau_completion)
|
19
18
|
completion =
|
20
19
|
tau_completion
|
21
20
|
.strip.split("\n")
|
22
|
-
.reject { |line|
|
23
|
-
line.include? 'options+=("--help")' or
|
24
|
-
line.include? 'options+=("-h")'
|
25
|
-
}
|
26
21
|
completion.pop
|
27
22
|
completion.join("\n")
|
28
23
|
end
|
29
|
-
# rubocop:enable Style/BlockDelimiters
|
30
24
|
|
31
25
|
# Remove bash completion functions
|
32
26
|
def _ship_completion_bash_remove_functions(completion)
|
@@ -9,12 +9,11 @@ module Takeltau
|
|
9
9
|
desc 'bash', 'Print bash completion code'
|
10
10
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
11
11
|
Print bash completion code
|
12
|
-
This command will print bash code which can be parsed to enable auto-completion for the
|
12
|
+
This command will print bash code which can be parsed to enable auto-completion for the takelship cli.
|
13
13
|
Add this to your bash startup files:
|
14
14
|
|
15
|
-
source <(
|
15
|
+
source <(ship completion bash)
|
16
16
|
LONGDESC
|
17
|
-
# Print bash completion code.
|
18
17
|
def bash
|
19
18
|
completion_bash = ship_completion_bash
|
20
19
|
exit false if completion_bash == false
|
@@ -13,13 +13,12 @@ module Takeltau
|
|
13
13
|
#
|
14
14
|
# ship container check existing
|
15
15
|
#
|
16
|
-
desc 'existing', 'Check if takelship is existing'
|
16
|
+
desc 'existing', 'Check if a takelship is existing'
|
17
17
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
18
18
|
Check if a takelship container is existing
|
19
19
|
This check looks for a container with a given name.
|
20
20
|
If such a container is existing the result is true else false.
|
21
21
|
LONGDESC
|
22
|
-
# Check if takelship container is existing.
|
23
22
|
def existing
|
24
23
|
exit ship_container_check_existing
|
25
24
|
end
|
@@ -19,17 +19,16 @@ module Takeltau
|
|
19
19
|
include ShipContainerStop
|
20
20
|
include ShipContainerUpdate
|
21
21
|
|
22
|
-
desc 'check [COMMAND]', 'Check takelship
|
22
|
+
desc 'check [COMMAND]', 'Check takelship containers'
|
23
23
|
subcommand 'check', ShipContainerCheck
|
24
24
|
|
25
25
|
#
|
26
26
|
# ship container clean
|
27
27
|
#
|
28
|
-
desc 'clean', 'Stop all
|
28
|
+
desc 'clean', 'Stop all takelships'
|
29
29
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
30
|
-
Stop all takelship containers
|
30
|
+
Stop all takelship containers.
|
31
31
|
LONGDESC
|
32
|
-
# Stop all takelship containers.
|
33
32
|
def clean
|
34
33
|
ship_container_clean
|
35
34
|
end
|
@@ -37,11 +36,10 @@ module Takeltau
|
|
37
36
|
#
|
38
37
|
# ship container command
|
39
38
|
#
|
40
|
-
desc 'command', 'Run a
|
39
|
+
desc 'command [COMMAND]', 'Run a [COMMAND] in a takelship container'
|
41
40
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
42
|
-
Run a command in a takelship container
|
41
|
+
Run a command in a takelship container as user podman.
|
43
42
|
LONGDESC
|
44
|
-
# Run a command in a takelship container.
|
45
43
|
def command(*args)
|
46
44
|
say ship_container_command args
|
47
45
|
end
|
@@ -49,11 +47,10 @@ module Takeltau
|
|
49
47
|
#
|
50
48
|
# ship container list
|
51
49
|
#
|
52
|
-
desc 'list', 'List
|
50
|
+
desc 'list', 'List takelships'
|
53
51
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
54
|
-
List
|
52
|
+
List takelship containers.
|
55
53
|
LONGDESC
|
56
|
-
# List takelage containers.
|
57
54
|
def list
|
58
55
|
say ship_container_list
|
59
56
|
end
|
@@ -63,9 +60,8 @@ module Takeltau
|
|
63
60
|
#
|
64
61
|
desc 'login', 'Log in to a takelship'
|
65
62
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
66
|
-
Log in to a takelship
|
63
|
+
Log in to a takelship as root.
|
67
64
|
LONGDESC
|
68
|
-
# Log in to a takelship.
|
69
65
|
def login
|
70
66
|
ship_container_login
|
71
67
|
end
|
@@ -73,11 +69,10 @@ module Takeltau
|
|
73
69
|
#
|
74
70
|
# ship container podman
|
75
71
|
#
|
76
|
-
desc 'podman', 'Run podman
|
72
|
+
desc 'podman [COMMAND]', 'Run a podman [COMMAND] in a takelship'
|
77
73
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
78
|
-
Run podman command
|
74
|
+
Run a podman command as user podman in a takelship container.
|
79
75
|
LONGDESC
|
80
|
-
# Run podman command.
|
81
76
|
def podman(*args)
|
82
77
|
say ship_container_podman args
|
83
78
|
end
|
@@ -85,11 +80,10 @@ module Takeltau
|
|
85
80
|
#
|
86
81
|
# ship container sudo
|
87
82
|
#
|
88
|
-
desc 'sudo', 'Run a sudo
|
83
|
+
desc 'sudo [COMMAND]', 'Run a sudo [COMMAND] in a takelship'
|
89
84
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
90
|
-
Run a
|
85
|
+
Run a command as root in a takelship container.
|
91
86
|
LONGDESC
|
92
|
-
# Run a sudo command in a takelship container.
|
93
87
|
def sudo(*args)
|
94
88
|
say ship_container_sudo args
|
95
89
|
end
|
@@ -97,11 +91,10 @@ module Takeltau
|
|
97
91
|
#
|
98
92
|
# ship container stop
|
99
93
|
#
|
100
|
-
desc 'stop', 'Stop takelship
|
94
|
+
desc 'stop', 'Stop a takelship'
|
101
95
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
102
|
-
Stop takelship container
|
96
|
+
Stop a takelship container.
|
103
97
|
LONGDESC
|
104
|
-
# Stop takelship container.
|
105
98
|
def stop
|
106
99
|
ship_container_stop
|
107
100
|
end
|
@@ -111,9 +104,8 @@ module Takeltau
|
|
111
104
|
#
|
112
105
|
desc 'update', 'Update takelship image'
|
113
106
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
114
|
-
Update takelship image
|
107
|
+
Update the takelship docker image.
|
115
108
|
LONGDESC
|
116
|
-
# Update takelship image.
|
117
109
|
def update
|
118
110
|
ship_container_update
|
119
111
|
end
|
@@ -10,27 +10,30 @@ module Takeltau
|
|
10
10
|
include ShipContainerLib
|
11
11
|
include ShipInfoLib
|
12
12
|
|
13
|
-
|
14
|
-
# ship info json
|
15
|
-
#
|
16
|
-
desc 'json', 'Print json takelship info'
|
13
|
+
desc 'takelconfig', 'Print takelage config'
|
17
14
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
18
|
-
|
15
|
+
Print takelage config.
|
16
|
+
The configuration values can be overwritten by a
|
17
|
+
1. ~/.takelage.yml in your home directory
|
18
|
+
2. takelage.yml next to a takelship directory
|
19
|
+
3. environment variables like TAKELAGE_TAU_CONFIG_SHIP_NAME
|
20
|
+
Alias for tau self config.
|
19
21
|
LONGDESC
|
20
|
-
#
|
21
|
-
def
|
22
|
-
|
22
|
+
# ship takelconfig: {Takeltau::SelfConfig#active}
|
23
|
+
def takelconfig
|
24
|
+
Takeltau::SelfConfig.new.active
|
23
25
|
end
|
24
26
|
|
25
27
|
#
|
26
|
-
# ship info
|
28
|
+
# ship info takelship
|
27
29
|
#
|
28
|
-
desc '
|
30
|
+
desc 'takelship', 'Print takelship info'
|
29
31
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
30
|
-
|
32
|
+
Print takelship info.
|
33
|
+
This info is read from a takelship.yml file in a takelship directory.
|
34
|
+
If no such file exists the info is gathered from a takelship.
|
31
35
|
LONGDESC
|
32
|
-
|
33
|
-
def yaml
|
36
|
+
def takelship
|
34
37
|
say _ship_info_lib_get_takelshipinfo.to_yaml
|
35
38
|
end
|
36
39
|
end
|
@@ -19,11 +19,10 @@ module Takeltau
|
|
19
19
|
#
|
20
20
|
# ship container list
|
21
21
|
#
|
22
|
-
desc 'list', 'List projects'
|
22
|
+
desc 'list', 'List takelship projects'
|
23
23
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
24
|
-
List projects
|
24
|
+
List all available takelship projects.
|
25
25
|
LONGDESC
|
26
|
-
# List projects.
|
27
26
|
def list
|
28
27
|
ship_project_list
|
29
28
|
end
|
@@ -31,11 +30,10 @@ module Takeltau
|
|
31
30
|
#
|
32
31
|
# ship container logs
|
33
32
|
#
|
34
|
-
desc 'logs [PROJECT]', 'Follow logs of
|
33
|
+
desc 'logs [PROJECT]', 'Follow logs of [PROJECT]'
|
35
34
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
36
|
-
Follow logs of project [PROJECT]
|
35
|
+
Follow logs of project [PROJECT] in a takelship project.
|
37
36
|
LONGDESC
|
38
|
-
# logs projects.
|
39
37
|
def logs(project = 'default')
|
40
38
|
ship_project_logs project
|
41
39
|
end
|
@@ -43,11 +41,10 @@ module Takeltau
|
|
43
41
|
#
|
44
42
|
# ship container start
|
45
43
|
#
|
46
|
-
desc 'start [PROJECT]', 'Start
|
44
|
+
desc 'start [PROJECT]', 'Start takelship [PROJECT]'
|
47
45
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
48
|
-
Start project [PROJECT] in
|
46
|
+
Start a takelship and run project [PROJECT] in it.
|
49
47
|
LONGDESC
|
50
|
-
# Run command in docker container.
|
51
48
|
def start(project = 'default')
|
52
49
|
ship_project_start project
|
53
50
|
end
|
@@ -55,11 +52,10 @@ module Takeltau
|
|
55
52
|
#
|
56
53
|
# ship project stop
|
57
54
|
#
|
58
|
-
desc 'stop', 'Stop a takelship
|
55
|
+
desc 'stop', 'Stop a takelship project'
|
59
56
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
60
|
-
Stop a takelship container
|
57
|
+
Stop a takelship container running a project.
|
61
58
|
LONGDESC
|
62
|
-
# Stop a takelship container.
|
63
59
|
def stop
|
64
60
|
say ship_container_stop
|
65
61
|
end
|
data/lib/takeltau/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.44.2
|
data/lib/takeltau.rb
CHANGED
@@ -127,6 +127,10 @@ module Takeltau
|
|
127
127
|
aliases: 'l',
|
128
128
|
default: 'INFO',
|
129
129
|
desc: 'One of: FATAL, ERROR, WARN, INFO, DEBUG'
|
130
|
+
option :workdir,
|
131
|
+
aliases: 'w',
|
132
|
+
default: '',
|
133
|
+
desc: 'Working directory'
|
130
134
|
# Initialize takelage cli.
|
131
135
|
def initialize(args = [], local_options = {}, configuration = {})
|
132
136
|
# Initialize thor parent class
|
@@ -136,7 +140,7 @@ module Takeltau
|
|
136
140
|
initialize_logging options[:loglevel].to_s.upcase
|
137
141
|
|
138
142
|
# Initialize global singleton config
|
139
|
-
initialize_config
|
143
|
+
initialize_config options[:workdir]
|
140
144
|
|
141
145
|
# Initialize global singleton project
|
142
146
|
initialize_project
|