takeltau 0.43.21 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 832353b2ae214df0ae1a9e9ecfe3ea6a7f1f7999dbddf3733f07603833942551
4
- data.tar.gz: b3ecded0a2496dca08ad07c8ca0966400a3fdbf004b69030ee5473cda1992072
3
+ metadata.gz: 91c0fd02dbdf001b8c5fa156dda3652f49e03478e9f8f1815242c309acaf29a4
4
+ data.tar.gz: 9e729bcd61aff9974a34e7a6f203ac628e99c359ef0eb1756329cd88bbadba17
5
5
  SHA512:
6
- metadata.gz: 8919bbdb435d07d30fd983876e2b64aa86917c4ca02a27a8dd0a7d74a7430e1afcfe1f4aece360e91bf380dc6d974954240125071cda021e6e83afe7cfed529a
7
- data.tar.gz: b24bcc03bdd925973d9f6f77de6e0d02f50e25f1e9706e8e5b826737c212ae57609dad2e7768a48e4d18032f1b719da907821863e5867eacfb4a785543165358
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
- Please remember that a project directory is identified by the main
150
- [Rakefile](Rakefile).
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
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- system "TAKELAGE_TAU_SHIP=#{$PROGRAM_NAME} tau ship #{ARGV.join(' ')}"
4
+ system "TAKELAGE_TAU_TAU=#{$PROGRAM_NAME} TAKELAGE_TAU_SHIP=true tau ship #{ARGV.join(' ')}"
@@ -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
- (run cmd_get_mounted_dir).strip
200
+ _docker_container_lib_homify_dir run cmd_get_mounted_dir
197
201
  end
198
202
  end
199
203
  # rubocop:enable Style/IfUnlessModifier
@@ -14,7 +14,7 @@ module InitPackerDocker
14
14
  exit_code = _init_packer_docker_create_project files
15
15
 
16
16
  # reinitialize config with newly created files
17
- initialize_config
17
+ initialize_config ''
18
18
 
19
19
  return false unless _init_lib_hg_clone
20
20
 
@@ -14,7 +14,7 @@ module InitTakelageRake
14
14
  exit_code = _init_takelage_rake_create_project files
15
15
 
16
16
  # reinitialize config with newly created files
17
- initialize_config
17
+ initialize_config ''
18
18
 
19
19
  return false unless _init_lib_hg_clone
20
20
 
@@ -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
- def _get_project_root_dir
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']
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
@@ -32,49 +32,101 @@ module Takeltau
32
32
  # Top-level ship commands
33
33
  #
34
34
 
35
- desc 'list', 'Alias for tau ship container list'
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]', 'Alias for tau ship project logs'
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', 'Alias for tau ship container list'
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', 'Alias for tau ship container 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 [ARGS]', 'Alias for tau ship container 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 'start [PROJECT]', 'Alias for tau ship project start'
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
100
+ # ship sudo: {Takeltau::ShipContainer#sudo}
101
+ def sudo(*args)
102
+ Takeltau::ShipContainer.new.sudo args
103
+ end
104
+
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
66
110
  # ship start: {Takeltau::ShipProject#start}
67
111
  def start(project = 'default')
68
112
  Takeltau::ShipProject.new.start project
69
113
  end
70
114
 
71
- desc 'stop', 'Alias for tau ship project 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
72
120
  # ship stop: {Takeltau::ShipProject#stop}
73
121
  def stop
74
122
  Takeltau::ShipProject.new.stop
75
123
  end
76
124
 
77
- desc 'update', 'Alias for tau ship container 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
78
130
  # tau update: {Takeltau::ShipContainer#update}
79
131
  def update
80
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 takelage cli.
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 <(tau completion bash)
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
@@ -14,32 +14,43 @@ module Takeltau
14
14
  include ShipContainerList
15
15
  include ShipContainerLogin
16
16
  include ShipContainerPodman
17
+ include ShipContainerCommand
18
+ include ShipContainerSudo
17
19
  include ShipContainerStop
18
20
  include ShipContainerUpdate
19
21
 
20
- desc 'check [COMMAND]', 'Check takelship container'
22
+ desc 'check [COMMAND]', 'Check takelship containers'
21
23
  subcommand 'check', ShipContainerCheck
22
24
 
23
25
  #
24
26
  # ship container clean
25
27
  #
26
- desc 'clean', 'Stop all takelship containers'
28
+ desc 'clean', 'Stop all takelships'
27
29
  long_desc <<-LONGDESC.gsub("\n", "\x5")
28
- Stop all takelship containers
30
+ Stop all takelship containers.
29
31
  LONGDESC
30
- # Stop all takelship containers.
31
32
  def clean
32
33
  ship_container_clean
33
34
  end
34
35
 
36
+ #
37
+ # ship container command
38
+ #
39
+ desc 'command [COMMAND]', 'Run a [COMMAND] in a takelship container'
40
+ long_desc <<-LONGDESC.gsub("\n", "\x5")
41
+ Run a command in a takelship container as user podman.
42
+ LONGDESC
43
+ def command(*args)
44
+ say ship_container_command args
45
+ end
46
+
35
47
  #
36
48
  # ship container list
37
49
  #
38
- desc 'list', 'List takelship containers'
50
+ desc 'list', 'List takelships'
39
51
  long_desc <<-LONGDESC.gsub("\n", "\x5")
40
- List takelage containers
52
+ List takelship containers.
41
53
  LONGDESC
42
- # List takelage containers.
43
54
  def list
44
55
  say ship_container_list
45
56
  end
@@ -49,9 +60,8 @@ module Takeltau
49
60
  #
50
61
  desc 'login', 'Log in to a takelship'
51
62
  long_desc <<-LONGDESC.gsub("\n", "\x5")
52
- Log in to a takelship
63
+ Log in to a takelship as root.
53
64
  LONGDESC
54
- # Log in to a takelship.
55
65
  def login
56
66
  ship_container_login
57
67
  end
@@ -59,23 +69,32 @@ module Takeltau
59
69
  #
60
70
  # ship container podman
61
71
  #
62
- desc 'podman', 'Run podman command'
72
+ desc 'podman [COMMAND]', 'Run a podman [COMMAND] in a takelship'
63
73
  long_desc <<-LONGDESC.gsub("\n", "\x5")
64
- Run podman command
74
+ Run a podman command as user podman in a takelship container.
65
75
  LONGDESC
66
- # Run podman command.
67
76
  def podman(*args)
68
77
  say ship_container_podman args
69
78
  end
70
79
 
80
+ #
81
+ # ship container sudo
82
+ #
83
+ desc 'sudo [COMMAND]', 'Run a sudo [COMMAND] in a takelship'
84
+ long_desc <<-LONGDESC.gsub("\n", "\x5")
85
+ Run a command as root in a takelship container.
86
+ LONGDESC
87
+ def sudo(*args)
88
+ say ship_container_sudo args
89
+ end
90
+
71
91
  #
72
92
  # ship container stop
73
93
  #
74
- desc 'stop', 'Stop takelship container'
94
+ desc 'stop', 'Stop a takelship'
75
95
  long_desc <<-LONGDESC.gsub("\n", "\x5")
76
- Stop takelship container
96
+ Stop a takelship container.
77
97
  LONGDESC
78
- # Stop takelship container.
79
98
  def stop
80
99
  ship_container_stop
81
100
  end
@@ -85,9 +104,8 @@ module Takeltau
85
104
  #
86
105
  desc 'update', 'Update takelship image'
87
106
  long_desc <<-LONGDESC.gsub("\n", "\x5")
88
- Update takelship image
107
+ Update the takelship docker image.
89
108
  LONGDESC
90
- # Update takelship image.
91
109
  def update
92
110
  ship_container_update
93
111
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # tau ship container command
4
+ module ShipContainerCommand
5
+ # Run a command in a takelship
6
+ def ship_container_command(args)
7
+ return false unless ship_container_check_existing
8
+
9
+ _ship_container_lib_docker_exec "pod #{args.join(' ')}"
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # tau ship container sudo
4
+ module ShipContainerSudo
5
+ # Run a sudo command in a takelship
6
+ def ship_container_sudo(args)
7
+ return false unless ship_container_check_existing
8
+
9
+ _ship_container_lib_docker_exec args.join(' ')
10
+ end
11
+ 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
- Print json takelship info
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
- # Print json takelship info.
21
- def json
22
- say _ship_info_lib_get_takelshipinfo.to_json
22
+ # ship takelconfig: {Takeltau::SelfConfig#active}
23
+ def takelconfig
24
+ Takeltau::SelfConfig.new.active
23
25
  end
24
26
 
25
27
  #
26
- # ship info yaml
28
+ # ship info takelship
27
29
  #
28
- desc 'yaml', 'Print yaml takelship info'
30
+ desc 'takelship', 'Print takelship info'
29
31
  long_desc <<-LONGDESC.gsub("\n", "\x5")
30
- Print yaml takelship info
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
- # Print yaml takelship info.
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 project [PROJECT]'
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 project [PROJECT] in a takelship container'
44
+ desc 'start [PROJECT]', 'Start takelship [PROJECT]'
47
45
  long_desc <<-LONGDESC.gsub("\n", "\x5")
48
- Start project [PROJECT] in a takelship container
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 container'
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.43.21
1
+ 0.44.2
data/lib/takeltau.rb CHANGED
@@ -90,8 +90,10 @@ require_relative 'takeltau/ship/container/check/cli'
90
90
  require_relative 'takeltau/ship/info/lib'
91
91
  require_relative 'takeltau/ship/container/list'
92
92
  require_relative 'takeltau/ship/container/clean'
93
+ require_relative 'takeltau/ship/container/command'
93
94
  require_relative 'takeltau/ship/container/login'
94
95
  require_relative 'takeltau/ship/container/podman'
96
+ require_relative 'takeltau/ship/container/sudo'
95
97
  require_relative 'takeltau/ship/container/stop'
96
98
  require_relative 'takeltau/ship/container/update'
97
99
  require_relative 'takeltau/ship/container/cli'
@@ -125,6 +127,10 @@ module Takeltau
125
127
  aliases: 'l',
126
128
  default: 'INFO',
127
129
  desc: 'One of: FATAL, ERROR, WARN, INFO, DEBUG'
130
+ option :workdir,
131
+ aliases: 'w',
132
+ default: '',
133
+ desc: 'Working directory'
128
134
  # Initialize takelage cli.
129
135
  def initialize(args = [], local_options = {}, configuration = {})
130
136
  # Initialize thor parent class
@@ -134,7 +140,7 @@ module Takeltau
134
140
  initialize_logging options[:loglevel].to_s.upcase
135
141
 
136
142
  # Initialize global singleton config
137
- initialize_config
143
+ initialize_config options[:workdir]
138
144
 
139
145
  # Initialize global singleton project
140
146
  initialize_project
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.21
4
+ version: 0.44.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takelwerk
@@ -290,11 +290,13 @@ files:
290
290
  - lib/takeltau/ship/container/check/existing.rb
291
291
  - lib/takeltau/ship/container/clean.rb
292
292
  - lib/takeltau/ship/container/cli.rb
293
+ - lib/takeltau/ship/container/command.rb
293
294
  - lib/takeltau/ship/container/lib.rb
294
295
  - lib/takeltau/ship/container/list.rb
295
296
  - lib/takeltau/ship/container/login.rb
296
297
  - lib/takeltau/ship/container/podman.rb
297
298
  - lib/takeltau/ship/container/stop.rb
299
+ - lib/takeltau/ship/container/sudo.rb
298
300
  - lib/takeltau/ship/container/update.rb
299
301
  - lib/takeltau/ship/info/cli.rb
300
302
  - lib/takeltau/ship/info/lib.rb