Sha256: c13028b2c664654bc2225ac78dfff0851502a2f8e117287f0ab9f0df2a44643b

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

# resolve bin path, ignoring symlinks
require 'pathname'
bin_file = Pathname.new(__FILE__).realpath

# add self to libpath
$:.unshift File.expand_path('../../lib', bin_file)

require 'kontena_cli'
STDOUT.sync = true

begin
  Kontena::PluginManager.instance.load_plugins
  Kontena::MainCommand.run
rescue Excon::Errors::SocketError => exc
  if exc.message.include?('Unable to verify certificate')
    $stderr.puts "The server uses a certificate signed by an unknown authority.".colorize(:red)
    $stderr.puts "You can trust this server by copying server CA pem file to: #{"~/.kontena/certs/<hostname>.pem".colorize(:light_black)}"
    $stderr.puts "Protip: you can bypass the certificate check by setting #{'SSL_IGNORE_ERRORS=true'.colorize(:yellow)} env variable, but any data you send to the server could be intercepted by others."
    exit(1)
  else
    abort(exc.message)
  end
rescue Kontena::Errors::StandardError => exc
  raise exc if ENV['DEBUG']
  abort(exc.message)
rescue => exc
  raise exc if ENV['DEBUG']
  $stderr.puts "Kontena error: #{exc.message}"
  $stderr.puts "Rerun the command with environment DEBUG=true set to get the full exception"
  abort
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 bin/kontena
kontena-cli-0.15.5.rc2 bin/kontena
kontena-cli-0.15.5.rc1 bin/kontena
kontena-cli-0.16.0.pre5 bin/kontena
kontena-cli-0.16.0.pre4 bin/kontena
kontena-cli-0.16.0.pre3 bin/kontena
kontena-cli-0.16.0.pre2 bin/kontena
kontena-cli-0.16.0.pre1 bin/kontena
kontena-cli-0.15.4 bin/kontena
kontena-cli-0.15.4.rc2 bin/kontena
kontena-cli-0.15.4.rc1 bin/kontena
kontena-cli-0.15.4.pre1 bin/kontena
kontena-cli-0.15.3 bin/kontena
kontena-cli-0.15.2 bin/kontena
kontena-cli-0.15.1 bin/kontena
kontena-cli-0.15.0 bin/kontena
kontena-cli-0.15.0.rc3 bin/kontena
kontena-cli-0.15.0.rc2 bin/kontena
kontena-cli-0.15.0.rc1 bin/kontena