hippo-cli 1.2.1 → 1.2.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -1
- data/cli/exec.rb +23 -0
- data/cli/run.rb +1 -1
- data/lib/hippo/manifest.rb +4 -0
- data/lib/hippo/stage.rb +10 -0
- data/lib/hippo/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
- data/cli/console.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b0705ed92b4a87716b435a10107d472adb75e391404c981e359a258318ed106
|
4
|
+
data.tar.gz: 385e2ec641b638bbdc9bd650174249bdd12a5c1304f76bd183402f99bf44b1c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f868b57d54be99ac4a00a7dc47581a1ffe37f5b33c41536d4b0dd326b32377a7a7cb4eaa8740ebda0b363cba30d0a71d4f9c22e0700c9836cb98468f1e40d67c
|
7
|
+
data.tar.gz: c2d27be5d0cb74d54499ebfd3b4bc4d0d9cd047a4e5675d5433aa6ccef24bab3e4d156b57bc1ea6c2ae8b04c6f90dc0eacf71b4b73469d60fd821c0e3edeac34
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
T��Aӝ����Bd�xͮe�Y��Q�ԮeOe��2=�P��҄y������`�X����'�u�Y�IQ6����g)X� �fe{�QmLI��?���-�������V�&g4�����M6F�B?��wZPI�<��˷{ÐGw�J�f<�G�ky8�?�QHl��ü���,H������^��ձ�1��%"�'S�W�q��%�|�W#j�x�F�C�����1����v�9�
|
data/cli/exec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
command :exec do
|
4
|
+
desc 'Exec a command on a given pod'
|
5
|
+
|
6
|
+
action do |context|
|
7
|
+
require 'hippo/cli'
|
8
|
+
cli = Hippo::CLI.setup(context)
|
9
|
+
cli.preflight
|
10
|
+
|
11
|
+
command = context.args[2]
|
12
|
+
if command.nil?
|
13
|
+
raise Error, 'Must specify command alias as first argument after `exec`'
|
14
|
+
end
|
15
|
+
|
16
|
+
command = cli.stage.command(command)
|
17
|
+
raise Error, "Invalid command alias `#{context.args[2]}`" if command.nil?
|
18
|
+
|
19
|
+
command_to_run = ([command[:command]] + context.args[3..-1]).join(' ')
|
20
|
+
|
21
|
+
exec cli.stage.kubectl("exec -it #{command[:target]} -- #{command_to_run}").join(' ')
|
22
|
+
end
|
23
|
+
end
|
data/cli/run.rb
CHANGED
@@ -12,7 +12,7 @@ command :run do
|
|
12
12
|
cli = Hippo::CLI.setup(context)
|
13
13
|
cli.preflight
|
14
14
|
|
15
|
-
image = cli.stage.images.values.first
|
15
|
+
image = cli.stage.images[context.options[:image]] || cli.stage.images.values.first
|
16
16
|
raise Error, "No image exists at #{image.image_url}" unless image.exists?
|
17
17
|
|
18
18
|
command = context.options[:command] || '/bin/bash'
|
data/lib/hippo/manifest.rb
CHANGED
data/lib/hippo/stage.rb
CHANGED
@@ -45,6 +45,16 @@ module Hippo
|
|
45
45
|
@options['config']
|
46
46
|
end
|
47
47
|
|
48
|
+
def command(name)
|
49
|
+
base = manifest.commands[name]
|
50
|
+
return nil if base.nil?
|
51
|
+
|
52
|
+
{
|
53
|
+
target: base['target'],
|
54
|
+
command: decorator.call(base['command'])
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
48
58
|
def images
|
49
59
|
@images ||= manifest.images.deep_merge(@options['images'] || {}).each_with_object({}) do |(key, image), hash|
|
50
60
|
hash[key] = Image.new(key, image)
|
data/lib/hippo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hippo-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
3wUJNGnT5XYq+qvTqmjkTSTfdGvZCM63C6bGdN5CAyMokGOOatGqyCMAONolWnfC
|
31
31
|
gm3t2GWWrxY=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2020-02-
|
33
|
+
date: 2020-02-23 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: encryptor
|
@@ -143,9 +143,9 @@ files:
|
|
143
143
|
- bin/hippo
|
144
144
|
- cli/apply_config.rb
|
145
145
|
- cli/apply_services.rb
|
146
|
-
- cli/console.rb
|
147
146
|
- cli/create.rb
|
148
147
|
- cli/deploy.rb
|
148
|
+
- cli/exec.rb
|
149
149
|
- cli/help.rb
|
150
150
|
- cli/init.rb
|
151
151
|
- cli/install.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/cli/console.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
command :console do
|
4
|
-
desc 'Open a console based on the configuration'
|
5
|
-
|
6
|
-
option '-d', '--deployment [NAME]', 'The name of the deployment to use' do |value, options|
|
7
|
-
options[:deployment] = value.to_s
|
8
|
-
end
|
9
|
-
|
10
|
-
option '-c', '--command [NAME]', 'The command to run' do |value, options|
|
11
|
-
options[:command] = value.to_s
|
12
|
-
end
|
13
|
-
|
14
|
-
action do |context|
|
15
|
-
require 'hippo/cli'
|
16
|
-
cli = Hippo::CLI.setup(context)
|
17
|
-
|
18
|
-
if cli.manifest.console.nil?
|
19
|
-
raise Error, 'No console configuration has been provided in Hippofile'
|
20
|
-
end
|
21
|
-
|
22
|
-
cli.preflight
|
23
|
-
|
24
|
-
time = Time.now.to_i
|
25
|
-
deployment_name = context.options[:deployment] || cli.manifest.console['deployment']
|
26
|
-
command = context.options[:command] || cli.manifest.console['command'] || 'bash'
|
27
|
-
exec cli.stage.kubectl("exec -it deployment/#{deployment_name} -- #{command}").join(' ')
|
28
|
-
end
|
29
|
-
end
|