Sha256: 08cd76de7d4089ca4b97d795f4e58b9bf6c2b023a4d01ee919712aae5fe99857

Contents?: true

Size: 1.29 KB

Versions: 45

Compression:

Stored size: 1.29 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 " [#{Kontena.pastel.red('error')}] The server uses a certificate signed by an unknown authority."
    $stderr.puts "         You can trust this server by copying server CA pem file to: #{Kontena.pastel.yellow("~/.kontena/certs/<hostname>.pem")}"
    $stderr.puts "         Protip: you can bypass the certificate check by setting #{Kontena.pastel.yellow('SSL_IGNORE_ERRORS=true')} env variable, but any data you send to the server could be intercepted by others."
    abort
  else
    abort(exc.message)
  end
rescue Kontena::Errors::StandardError => exc
  raise exc if ENV['DEBUG']
  puts " [#{Kontena.pastel.red('error')}] #{exc.message}"
  abort
rescue => exc
  raise exc if ENV['DEBUG']
  $stderr.puts " [#{Kontena.pastel.red('error')}] #{exc.message}"
  $stderr.puts "         Rerun the command with environment DEBUG=true set to get the full exception"
  abort
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
kontena-cli-1.0.6 bin/kontena
kontena-cli-1.0.6.rc1 bin/kontena
kontena-cli-1.0.5 bin/kontena
kontena-cli-1.0.5.rc1 bin/kontena
kontena-cli-1.0.5.pre1 bin/kontena
kontena-cli-1.0.4 bin/kontena
kontena-cli-1.0.4.rc2 bin/kontena
kontena-cli-1.0.4.rc1 bin/kontena
kontena-cli-1.0.3 bin/kontena
kontena-cli-1.0.3.rc1 bin/kontena
kontena-cli-1.0.2 bin/kontena
kontena-cli-1.0.2.rc2 bin/kontena
kontena-cli-1.0.2.rc1 bin/kontena
kontena-cli-1.0.2.pre1 bin/kontena
kontena-cli-1.0.1 bin/kontena
kontena-cli-1.0.1.rc3 bin/kontena
kontena-cli-1.0.1.rc2 bin/kontena
kontena-cli-1.0.1.rc1 bin/kontena
kontena-cli-1.0.0 bin/kontena
kontena-cli-1.0.0.rc2 bin/kontena