Sha256: b6ec9c67d3b588cc7a8a87b61d3ef147e1197035007af1bb8a2172dea7d326ed
Contents?: true
Size: 647 Bytes
Versions: 47
Compression:
Stored size: 647 Bytes
Contents
require_relative '../grid_options' module Kontena::Cli::Containers class ExecCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions parameter "CONTAINER_ID", "Container id" parameter "CMD ...", "Command" def execute require_api_url token = require_token payload = {cmd: ["sh", "-c", Shellwords.join(cmd_list)]} result = client(token).post("containers/#{current_grid}/#{container_id}/exec", payload) puts result[0].join(" ") unless result[0].size == 0 STDERR.puts result[1].join(" ") unless result[1].size == 0 exit result[2] end end end
Version data entries
47 entries across 47 versions & 1 rubygems