kontena-cli 0.16.0.pre7 → 0.16.0.pre8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/kontena-cli.gemspec +2 -5
- data/lib/kontena/callbacks/master/deploy/05_before_deploy_configuration_wizard.rb +15 -21
- data/lib/kontena/callbacks/master/deploy/50_authenticate_after_deploy.rb +5 -3
- data/lib/kontena/callbacks/master/deploy/55_create_initial_grid_after_deploy.rb +3 -1
- data/lib/kontena/callbacks/master/deploy/60_configure_auth_provider_after_deploy.rb +7 -18
- data/lib/kontena/callbacks/master/deploy/70_invite_self_after_deploy.rb +93 -0
- data/lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb +33 -0
- data/lib/kontena/cli/apps/build_command.rb +2 -1
- data/lib/kontena/cli/apps/common.rb +3 -2
- data/lib/kontena/cli/apps/config_command.rb +3 -3
- data/lib/kontena/cli/apps/deploy_command.rb +1 -0
- data/lib/kontena/cli/apps/docker_helper.rb +7 -7
- data/lib/kontena/cli/apps/list_command.rb +1 -1
- data/lib/kontena/cli/apps/logs_command.rb +1 -1
- data/lib/kontena/cli/apps/monitor_command.rb +2 -2
- data/lib/kontena/cli/apps/remove_command.rb +1 -1
- data/lib/kontena/cli/apps/restart_command.rb +1 -1
- data/lib/kontena/cli/apps/scale_command.rb +1 -1
- data/lib/kontena/cli/apps/start_command.rb +1 -1
- data/lib/kontena/cli/apps/stop_command.rb +1 -1
- data/lib/kontena/cli/apps/yaml/custom_validators/affinities_validator.rb +19 -0
- data/lib/kontena/cli/apps/yaml/custom_validators/build_validator.rb +22 -0
- data/lib/kontena/cli/apps/yaml/custom_validators/extends_validator.rb +21 -0
- data/lib/kontena/cli/apps/yaml/custom_validators/hooks_validator.rb +54 -0
- data/lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb +22 -0
- data/lib/kontena/cli/apps/yaml/validations.rb +60 -90
- data/lib/kontena/cli/apps/yaml/validator.rb +9 -31
- data/lib/kontena/cli/apps/yaml/validator_v2.rb +13 -40
- data/lib/kontena/cli/cloud/login_command.rb +2 -2
- data/lib/kontena/cli/cloud/master/add_command.rb +114 -34
- data/lib/kontena/cli/cloud/master/list_command.rb +5 -2
- data/lib/kontena/cli/cloud/master/remove_command.rb +69 -0
- data/lib/kontena/cli/cloud/master_command.rb +2 -2
- data/lib/kontena/cli/common.rb +10 -17
- data/lib/kontena/cli/config.rb +4 -3
- data/lib/kontena/cli/grids/env_command.rb +5 -5
- data/lib/kontena/cli/localhost_web_server.rb +1 -1
- data/lib/kontena/cli/master/init_cloud_command.rb +21 -0
- data/lib/kontena/cli/master/login_command.rb +28 -29
- data/lib/kontena/cli/master/remove_command.rb +58 -0
- data/lib/kontena/cli/master/token/create_command.rb +6 -0
- data/lib/kontena/cli/master/users/invite_command.rb +4 -1
- data/lib/kontena/cli/master/users/roles/add_command.rb +4 -3
- data/lib/kontena/cli/master_command.rb +8 -9
- data/lib/kontena/cli/services/list_command.rb +3 -2
- data/lib/kontena/cli/services/services_helper.rb +1 -1
- data/lib/kontena/client.rb +31 -47
- data/lib/kontena/presets/kontena_auth_provider.yml +2 -2
- data/lib/kontena_cli.rb +12 -0
- data/spec/kontena/cli/app/docker_helper_spec.rb +9 -4
- data/spec/kontena/cli/app/yaml/validator_spec.rb +66 -71
- data/spec/kontena/cli/app/yaml/validator_v2_spec.rb +51 -58
- metadata +25 -59
- data/lib/kontena/callbacks/master/deploy/90_suggest_inviting_yourself_after_deploy.rb +0 -24
- data/lib/kontena/cli/cloud/master/delete_command.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 549a20ff35d02d49d04d5589b5f5186b72de7ed6
|
4
|
+
data.tar.gz: e18b7450099a72993f8569ce271aaa72c5a3bf84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffe9ff495c0eab3b8e7076b429a24916a6c2f8fd459f2bb6142b50f97e4f52b54fa52342c1b80d117975653c6d39e3ec5f4e7a60c0f9479019fd6cd613a06410
|
7
|
+
data.tar.gz: aeb28936bece1fe439c6d57d1293cf94a922f8d9bf741e982872f5db44b14a3bcc1e532fc463c8ed9c200100cf32fdfa7fb4fcf737e81c6cf93f177bdb43318c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.16.0.
|
1
|
+
0.16.0.pre8
|
data/kontena-cli.gemspec
CHANGED
@@ -26,10 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_runtime_dependency "tty-prompt", "~> 0.7.1"
|
27
27
|
spec.add_runtime_dependency "clamp", "~> 1.0.0"
|
28
28
|
spec.add_runtime_dependency "ruby_dig", "~> 0.0.2"
|
29
|
-
spec.add_runtime_dependency "dry-validation", "0.8.0"
|
30
|
-
spec.add_runtime_dependency "dry-types", "0.8.0"
|
31
|
-
spec.add_runtime_dependency "dry-configurable", "0.1.6"
|
32
|
-
spec.add_runtime_dependency "dry-monads", "0.1.1"
|
33
|
-
spec.add_runtime_dependency "dry-logic", "0.3.0"
|
34
29
|
spec.add_runtime_dependency "launchy", "~> 2.4.3"
|
30
|
+
spec.add_runtime_dependency "hash_validator", "~> 0.7.0"
|
31
|
+
spec.add_runtime_dependency "retriable", "~> 2.1.0"
|
35
32
|
end
|
@@ -10,6 +10,7 @@ module Kontena
|
|
10
10
|
command.class_eval do
|
11
11
|
option ['--no-prompt'], :flag, "Don't ask questions"
|
12
12
|
option ['--skip-auth-provider'], :flag, "Skip auth provider configuration (single user mode)"
|
13
|
+
option ['--use-kontena-cloud'], :flag, "Use Kontena Cloud as authentication provider"
|
13
14
|
option ['--cloud-master-id'], '[ID]', "Use Kontena Cloud Master ID for auth provider configuration"
|
14
15
|
end
|
15
16
|
end
|
@@ -32,34 +33,30 @@ module Kontena
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def login_to_kontena
|
35
|
-
if
|
36
|
+
if cloud_auth?
|
36
37
|
return true if cloud_client.authentication_ok?(kontena_account.userinfo_endpoint)
|
37
38
|
end
|
38
39
|
puts
|
39
40
|
puts "You don't seem to be logged in to Kontena Cloud"
|
40
41
|
puts
|
41
42
|
Kontena.run("cloud login --verbose")
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def create_cloud_master
|
46
|
-
master_id = nil
|
47
|
-
begin
|
48
|
-
spinner "Registering a new master '#{command.name}' to Kontena Cloud" do
|
49
|
-
master_id = Kontena.run("cloud master add --return #{command.name}", returning: :result)
|
50
|
-
end
|
51
|
-
rescue SystemExit
|
52
|
-
end
|
53
|
-
if master_id.to_s =~ /^[0-9a-f]{16,32}$/
|
54
|
-
master_id
|
55
|
-
else
|
56
|
-
exit_with_error 'Cloud Master registration failed'
|
43
|
+
Retriable.retriable do
|
44
|
+
cloud_client.authentication_ok?(kontena_account.userinfo_endpoint)
|
57
45
|
end
|
58
46
|
end
|
59
47
|
|
60
48
|
def before
|
61
49
|
unless_param(:name) do
|
62
|
-
if command.
|
50
|
+
if command.cloud_master_id
|
51
|
+
response = spinner "Receiving Master information from Kontena Cloud" do
|
52
|
+
cloud_client.get("user/masters/#{command.cloud_master_id}")
|
53
|
+
end
|
54
|
+
if response.kind_of?(Hash) && response.has_key?('data')
|
55
|
+
command.name = response['data']['attributes']['name']
|
56
|
+
else
|
57
|
+
exit_with_error "Unable to receive Master information using id"
|
58
|
+
end
|
59
|
+
elsif command.no_prompt?
|
63
60
|
command.name = next_default_name
|
64
61
|
else
|
65
62
|
command.name = prompt.ask("Enter a name for this Kontena Master: ", default: next_default_name, required: true) do |q|
|
@@ -69,9 +66,7 @@ module Kontena
|
|
69
66
|
end
|
70
67
|
|
71
68
|
unless_param(:skip_auth_provider) do
|
72
|
-
|
73
|
-
command.cloud_master_id ||= create_cloud_master
|
74
|
-
elsif command.cloud_master_id.nil?
|
69
|
+
unless command.no_prompt? || command.use_kontena_cloud? || command.cloud_master_id
|
75
70
|
answer = prompt.select("Select OAuth2 authentication provider: ") do |menu|
|
76
71
|
menu.choice 'Kontena Cloud (recommended)', :kontena_new
|
77
72
|
menu.choice 'Custom', :custom
|
@@ -80,7 +75,6 @@ module Kontena
|
|
80
75
|
case answer
|
81
76
|
when :kontena_new
|
82
77
|
login_to_kontena || abort('You must login to Kontena Cloud')
|
83
|
-
command.cloud_master_id = create_cloud_master
|
84
78
|
command.skip_auth_provider = false
|
85
79
|
when :custom
|
86
80
|
puts
|
@@ -44,9 +44,11 @@ module Kontena
|
|
44
44
|
end
|
45
45
|
|
46
46
|
require 'shellwords'
|
47
|
-
cmd = "master login --skip-grid-auto-select --verbose --name #{command.result[:name].shellescape} --code #{command.result[:code].shellescape} #{new_master.url.shellescape}"
|
48
|
-
|
49
|
-
|
47
|
+
cmd = "master login --no-login-info --skip-grid-auto-select --verbose --name #{command.result[:name].shellescape} --code #{command.result[:code].shellescape} #{new_master.url.shellescape}"
|
48
|
+
Retriable.retriable do
|
49
|
+
ENV["DEBUG"] && puts("Running: #{cmd}")
|
50
|
+
Kontena.run(cmd)
|
51
|
+
end
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -6,22 +6,12 @@ module Kontena
|
|
6
6
|
|
7
7
|
matches_commands 'master create'
|
8
8
|
|
9
|
-
def
|
10
|
-
|
11
|
-
spinner "Retrieving master OAuth2 application settings from Kontena Cloud" do
|
12
|
-
attrs = cloud_client.get("user/masters/#{master_id}")["data"]["attributes"]
|
13
|
-
end
|
14
|
-
attrs
|
15
|
-
rescue
|
16
|
-
nil
|
9
|
+
def configure_auth_provider_using_id(cloud_id)
|
10
|
+
Kontena.run("master init-cloud --force --cloud-master-id #{cloud_id.shellescape}")
|
17
11
|
end
|
18
12
|
|
19
|
-
def configure_auth_provider
|
20
|
-
|
21
|
-
spinner "Setting Kontena Cloud authentication provider settings to Master config" do
|
22
|
-
Kontena.run("master config import --force --preset kontena_auth_provider")
|
23
|
-
Kontena.run("master config set oauth2.client_id=#{oauth_config['client-id'].shellescape} oauth2.client_secret=#{oauth_config['client-secret'].shellescape} server.root_url=#{config.current_master.url.shellescape}")
|
24
|
-
end
|
13
|
+
def configure_auth_provider
|
14
|
+
Kontena.run("master init-cloud --force")
|
25
15
|
end
|
26
16
|
|
27
17
|
def after
|
@@ -35,10 +25,9 @@ module Kontena
|
|
35
25
|
end
|
36
26
|
|
37
27
|
if command.respond_to?(:cloud_master_id) && command.cloud_master_id
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
28
|
+
configure_auth_provider_using_id(command.cloud_master_id)
|
29
|
+
else
|
30
|
+
configure_auth_provider
|
42
31
|
end
|
43
32
|
end
|
44
33
|
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Kontena
|
2
|
+
module Callbacks
|
3
|
+
class InviteSelfAfterDeploy < Kontena::Callback
|
4
|
+
|
5
|
+
include Kontena::Cli::Common
|
6
|
+
|
7
|
+
matches_commands 'master create'
|
8
|
+
|
9
|
+
def cloud_user_data
|
10
|
+
return @cloud_user_data if @cloud_user_data
|
11
|
+
return nil unless cloud_auth?
|
12
|
+
user_data = {}
|
13
|
+
response = nil
|
14
|
+
spinner "Retrieving user information from Kontena Cloud" do
|
15
|
+
response = cloud_client.get(kontena_account.userinfo_endpoint)
|
16
|
+
end
|
17
|
+
if response && response.kind_of?(Hash) && response.has_key?('data') && response['data'].has_key?('attributes')
|
18
|
+
user_data[:email] = response['data']['attributes']['email']
|
19
|
+
user_data[:username] = response['data']['attributes']['username']
|
20
|
+
user_data[:verified] = response['data']['attributes']['verified']
|
21
|
+
@cloud_user_data = user_data
|
22
|
+
end
|
23
|
+
@cloud_user_data
|
24
|
+
end
|
25
|
+
|
26
|
+
def after
|
27
|
+
return unless current_master
|
28
|
+
return unless command.exit_code == 0
|
29
|
+
return unless current_master.username.to_s == 'admin'
|
30
|
+
return nil if command.skip_auth_provider?
|
31
|
+
return nil unless cloud_user_data
|
32
|
+
|
33
|
+
invite_response = nil
|
34
|
+
spinner "Creating user #{cloud_user_data[:email]} into Kontena Master" do |spin|
|
35
|
+
invite_response = Kontena.run("master users invite --return #{cloud_user_data[:email].shellescape}", returning: :result)
|
36
|
+
unless invite_response.kind_of?(Hash) && invite_response.has_key?('invite_code')
|
37
|
+
spin.fail
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
return nil unless invite_response
|
42
|
+
ENV["DEBUG"] && puts("Got invite code: #{invite_response['invite_code']}")
|
43
|
+
|
44
|
+
role_status = nil
|
45
|
+
|
46
|
+
spinner "Adding master_admin role for #{cloud_user_data[:email]}" do |spin|
|
47
|
+
role_status = Kontena.run("master users role add --silent master_admin #{cloud_user_data[:email].shellescape}")
|
48
|
+
spin.fail if role_status.to_i > 0
|
49
|
+
end
|
50
|
+
|
51
|
+
return nil if role_status.to_i > 0
|
52
|
+
|
53
|
+
new_user_token = nil
|
54
|
+
spinner "Creating an access token for #{cloud_user_data[:email]}" do |spin|
|
55
|
+
new_user_token = Kontena.run("master token create -e 0 -s user --return -u #{cloud_user_data[:email].shellescape}", returning: :result)
|
56
|
+
end
|
57
|
+
|
58
|
+
master_name = current_master.name.dup
|
59
|
+
master_url = current_master.url
|
60
|
+
old_master = current_master
|
61
|
+
|
62
|
+
spinner "Copying server '#{current_master.name}' to '#{current_master.name}-admin' in configuration" do
|
63
|
+
config.servers << Kontena::Cli::Config::Server.new(
|
64
|
+
name: "#{current_master.name}-admin",
|
65
|
+
url: current_master.url,
|
66
|
+
username: 'admin',
|
67
|
+
grid: current_master.grid,
|
68
|
+
token: Kontena::Cli::Config::Token.new(
|
69
|
+
access_token: current_master.token.access_token,
|
70
|
+
refresh_token: current_master.token.refresh_token,
|
71
|
+
expires_at: current_master.token.expires_at,
|
72
|
+
parent_type: :master,
|
73
|
+
parent_name: "#{current_master.name}-admin"
|
74
|
+
),
|
75
|
+
account: 'master'
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
spinner "Authenticating as #{cloud_user_data[:email]} to Kontena Master '#{current_master.name}'" do
|
80
|
+
current_master.token = Kontena::Cli::Config::Token.new(
|
81
|
+
access_token: new_user_token[:access_token],
|
82
|
+
refresh_token: new_user_token[:refresh_token],
|
83
|
+
expires_at: new_user_token[:expires_in].to_i > 0 ? Time.now.utc.to_i + new_user_token[:expires_in].to_i : nil,
|
84
|
+
parent_type: :master,
|
85
|
+
parent_name: "#{current_master.name}"
|
86
|
+
)
|
87
|
+
current_master.username = new_user_token[:user_name].to_s == "" ? new_user_token[:user_email] : new_user_token[:user_name]
|
88
|
+
config.write
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Kontena
|
2
|
+
module Callbacks
|
3
|
+
class SuggestInvitingYourself < Kontena::Callback
|
4
|
+
|
5
|
+
include Kontena::Cli::Common
|
6
|
+
|
7
|
+
matches_commands 'master create'
|
8
|
+
|
9
|
+
def after
|
10
|
+
return unless current_master
|
11
|
+
return unless command.exit_code == 0
|
12
|
+
return if current_master.username.to_s == 'admin'
|
13
|
+
|
14
|
+
puts
|
15
|
+
puts Kontena.pastel.green("Protip:")
|
16
|
+
|
17
|
+
if config.find_server("#{current_master.name}-admin")
|
18
|
+
puts " You are currently using the Kontena Master '#{Kontena.pastel.yellow(current_master.name)}' as"
|
19
|
+
puts " #{Kontena.pastel.yellow(current_master.username)}. To switch to the Kontena Master internal"
|
20
|
+
puts " administrator you can use:"
|
21
|
+
puts " #{Kontena.pastel.green.on_black(" kontena master use #{current_master.name}-admin ")}"
|
22
|
+
puts
|
23
|
+
end
|
24
|
+
puts " To invite more users you can use:"
|
25
|
+
puts " #{Kontena.pastel.green.on_black(" kontena master users invite email_address@example.com ")}"
|
26
|
+
puts
|
27
|
+
puts " The users can then join the master by using the invite code: "
|
28
|
+
puts " #{Kontena.pastel.green.on_black(" kontena master join #{current_master.url} <invite_code> ")}"
|
29
|
+
puts
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -10,13 +10,14 @@ module Kontena::Cli::Apps
|
|
10
10
|
option ['-p', '--project-name'], 'NAME', 'Specify an alternate project name (default: directory name)'
|
11
11
|
option ['-f', '--file'], 'FILE', 'Specify an alternate Kontena compose file', attribute_name: :filename, default: 'kontena.yml'
|
12
12
|
option ['--no-cache'], :flag, 'Do not use cache when building the image', default: false
|
13
|
+
option '--skip-validation', :flag, 'Skip YAML file validation', default: false
|
13
14
|
parameter "[SERVICE] ...", "Services to build"
|
14
15
|
|
15
16
|
attr_reader :services
|
16
17
|
|
17
18
|
def execute
|
18
19
|
require_config_file(filename)
|
19
|
-
@services = services_from_yaml(filename, service_list, service_prefix)
|
20
|
+
@services = services_from_yaml(filename, service_list, service_prefix, skip_validation?)
|
20
21
|
if services.none?{ |name, service| service['build'] }
|
21
22
|
error 'Not found any service with build option'
|
22
23
|
abort
|
@@ -15,10 +15,11 @@ module Kontena::Cli::Apps
|
|
15
15
|
# @param [String] filename
|
16
16
|
# @param [Array<String>] service_list
|
17
17
|
# @param [String] prefix
|
18
|
+
# @param [TrueClass|FalseClass] skip_validation
|
18
19
|
# @return [Hash]
|
19
|
-
def services_from_yaml(filename, service_list, prefix)
|
20
|
+
def services_from_yaml(filename, service_list, prefix, skip_validation = false)
|
20
21
|
set_env_variables(prefix, current_grid)
|
21
|
-
reader = YAML::Reader.new(filename)
|
22
|
+
reader = YAML::Reader.new(filename, skip_validation)
|
22
23
|
outcome = reader.execute
|
23
24
|
hint_on_validation_notifications(outcome[:notifications]) if outcome[:notifications].size > 0
|
24
25
|
abort_on_validation_errors(outcome[:errors]) if outcome[:errors].size > 0
|
@@ -3,17 +3,17 @@ require 'pp'
|
|
3
3
|
|
4
4
|
module Kontena::Cli::Apps
|
5
5
|
class ConfigCommand < Kontena::Command
|
6
|
-
include Kontena::Cli::Common
|
6
|
+
include Kontena::Cli::Common
|
7
7
|
include Common
|
8
8
|
|
9
9
|
option ['-f', '--file'], 'FILE', 'Specify an alternate Kontena compose file', attribute_name: :filename, default: 'kontena.yml'
|
10
10
|
option ['-p', '--project-name'], 'NAME', 'Specify an alternate project name (default: directory name)'
|
11
|
-
|
11
|
+
option '--skip-validation', :flag, 'Skip YAML file validation', default: false
|
12
12
|
parameter "[SERVICE] ...", "Services to view"
|
13
13
|
|
14
14
|
def execute
|
15
15
|
require_config_file(filename)
|
16
|
-
services = services_from_yaml(filename, service_list, service_prefix)
|
16
|
+
services = services_from_yaml(filename, service_list, service_prefix, skip_validation?)
|
17
17
|
services.each do |name, config|
|
18
18
|
config['cmd'] = config['cmd'].join(" ") if config['cmd']
|
19
19
|
config.delete_if {|key, value| value.nil? || (value.respond_to?(:empty?) && value.empty?) }
|
@@ -16,6 +16,7 @@ module Kontena::Cli::Apps
|
|
16
16
|
option '--force', :flag, 'Force deploy even if service does not have any changes'
|
17
17
|
option '--force-deploy', :flag, '[DEPRECATED: use --force]'
|
18
18
|
|
19
|
+
option '--skip-validation', :flag, 'Skip YAML file validation', default: false
|
19
20
|
parameter "[SERVICE] ...", "Services to start"
|
20
21
|
|
21
22
|
attr_reader :services, :deploy_queue
|
@@ -34,15 +34,15 @@ module Kontena::Cli::Apps
|
|
34
34
|
def build_docker_image(service, no_cache = false)
|
35
35
|
dockerfile = dockerfile = service['build']['dockerfile'] || 'Dockerfile'
|
36
36
|
build_context = service['build']['context']
|
37
|
-
cmd = [
|
38
|
-
cmd <<
|
39
|
-
cmd <<
|
37
|
+
cmd = ['docker', 'build', '-t', service['image']]
|
38
|
+
cmd << ['-f', File.join(File.expand_path(build_context), dockerfile)] if dockerfile != "Dockerfile"
|
39
|
+
cmd << '--no-cache' if no_cache
|
40
40
|
args = service['build']['args'] || {}
|
41
41
|
args.each do |k, v|
|
42
|
-
cmd << "--build-arg
|
42
|
+
cmd << "--build-arg=#{k}=#{v}"
|
43
43
|
end
|
44
44
|
cmd << build_context
|
45
|
-
ret = system(cmd.
|
45
|
+
ret = system(*cmd.flatten)
|
46
46
|
raise ("Failed to build image #{service['image'].colorize(:cyan)}") unless ret
|
47
47
|
ret
|
48
48
|
end
|
@@ -50,7 +50,7 @@ module Kontena::Cli::Apps
|
|
50
50
|
# @param [String] image
|
51
51
|
# @return [Integer]
|
52
52
|
def push_docker_image(image)
|
53
|
-
ret = system(
|
53
|
+
ret = system('docker', 'push', image)
|
54
54
|
raise ("Failed to push image #{image.colorize(:cyan)}") unless ret
|
55
55
|
ret
|
56
56
|
end
|
@@ -58,7 +58,7 @@ module Kontena::Cli::Apps
|
|
58
58
|
# @param [String] image
|
59
59
|
# @return [Boolean]
|
60
60
|
def image_exist?(image)
|
61
|
-
|
61
|
+
system("docker history '#{image}' >/dev/null 2>/dev/null")
|
62
62
|
end
|
63
63
|
|
64
64
|
# @param [String] path
|
@@ -16,7 +16,7 @@ module Kontena::Cli::Apps
|
|
16
16
|
def execute
|
17
17
|
require_config_file(filename)
|
18
18
|
|
19
|
-
@services = services_from_yaml(filename, service_list, service_prefix)
|
19
|
+
@services = services_from_yaml(filename, service_list, service_prefix, true)
|
20
20
|
if services.size > 0
|
21
21
|
show_services(services)
|
22
22
|
elsif !service_list.empty?
|
@@ -16,7 +16,7 @@ module Kontena::Cli::Apps
|
|
16
16
|
def execute
|
17
17
|
require_config_file(filename)
|
18
18
|
|
19
|
-
services = services_from_yaml(filename, service_list, service_prefix)
|
19
|
+
services = services_from_yaml(filename, service_list, service_prefix, true)
|
20
20
|
|
21
21
|
if services.empty? && !service_list.empty?
|
22
22
|
signal_error "No such service: #{service_list.join(', ')}"
|
@@ -15,8 +15,8 @@ module Kontena::Cli::Apps
|
|
15
15
|
|
16
16
|
def execute
|
17
17
|
require_config_file(filename)
|
18
|
-
|
19
|
-
@services = services_from_yaml(filename, service_list, service_prefix)
|
18
|
+
|
19
|
+
@services = services_from_yaml(filename, service_list, service_prefix, true)
|
20
20
|
if services.size > 0
|
21
21
|
show_monitor(services)
|
22
22
|
elsif !service_list.empty?
|
@@ -20,7 +20,7 @@ module Kontena::Cli::Apps
|
|
20
20
|
require_config_file(filename)
|
21
21
|
confirm unless forced?
|
22
22
|
|
23
|
-
@services = services_from_yaml(filename, service_list, service_prefix)
|
23
|
+
@services = services_from_yaml(filename, service_list, service_prefix, true)
|
24
24
|
if services.size > 0
|
25
25
|
remove_services(services)
|
26
26
|
elsif !service_list.empty?
|