struct

Swarmy::Server

Inherits Struct < Value < Object

A named remote Docker Swarm host, reachable over SSH.

Servers are typically loaded from ~/.config/swarmy/servers.yml via .load_all, but can also be built ad hoc (e.g. from --host/--user/--port).

Constants

DEFAULT_PATH = File.join(ENV["HOME"]? || "", ".config", "swarmy", "servers.yml")

Default location of the saved-servers YAML file, under the user's config dir.

Constructors

new(name : String, host : String, user : Nil | String = nil, port : Int32 | Nil = nil)
Source

Class methods

find(name : String, servers : Array(Server) = load_all) : Server | Nil

Finds a saved server by name, or nil if none matches.

Source
load_all(path : String = DEFAULT_PATH) : Array(Server)

Loads all servers saved at path.

Returns an empty array if the file is missing, has no servers key, or fails to parse as YAML (a warning is printed to stderr in that case).

Source
save(server : Server, path : String = DEFAULT_PATH) : Nil

Persists server to path, replacing any existing entry with the same name.

Source

Instance methods

docker_host

Builds the ssh:// URL used as DOCKER_HOST to reach this server.

Source
host
Source
name
Source
port
Source
user
Source