Sha256: 77bde06a80ede3e31dd000a57cfaf7263d9a39ea3af51a1cb7c0929429a65172
Contents?: true
Size: 813 Bytes
Versions: 2
Compression:
Stored size: 813 Bytes
Contents
require_relative 'common' module Kontena::Cli::Grids class EnvCommand < Clamp::Command include Kontena::Cli::Common include Common parameter "[NAME]", "Grid name" option ["-e", "--export"], :flag, "Add export", default: false def execute require_api_url name_or_current = name.nil? ? current_grid : name if name_or_current.nil? abort "No grid selected. Use: kontena grid env <name>, or select a grid with: kontena grid use <name>" else grid = find_grid_by_name(name_or_current) abort("Grid not found".colorize(:red)) unless grid prefix = export? ? 'export ' : '' puts "#{prefix}KONTENA_URI=#{settings['server']['url'].sub('http', 'ws')}" puts "#{prefix}KONTENA_TOKEN=#{grid['token']}" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kontena-cli-0.11.1 | lib/kontena/cli/grids/env_command.rb |
kontena-cli-0.11.0 | lib/kontena/cli/grids/env_command.rb |