Sha256: d683cc7cec98ec8b93eacd56c0a9af1d2e474a7f275a8c46e8ad815377548bfc
Contents?: true
Size: 711 Bytes
Versions: 92
Compression:
Stored size: 711 Bytes
Contents
class KuberKit::ImageCompiler::BuildServerPool attr_reader :ssh_shells, :local_shell def initialize(local_shell:, build_servers:, ssh_shell_class:) @local_shell = local_shell @ssh_shell_class = ssh_shell_class @build_servers = build_servers @ssh_shells = [] end def get_shell if @build_servers.any? shell = connect_to_ssh_shell(@build_servers.sample) @ssh_shells << shell shell else @local_shell end end def disconnect_all @ssh_shells.each(&:disconnect) end private def connect_to_ssh_shell(bs) shell = @ssh_shell_class.new shell.connect(host: bs.host, user: bs.user, port: bs.port) shell end end
Version data entries
92 entries across 92 versions & 1 rubygems