struct
Swarmy::Server
- Swarmy::Server
- Struct
- Value
- Object
Overview
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).
Defined in:
swarmy/server.crConstant Summary
-
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
Class Method Summary
-
.find(name : String, servers : Array(Server) = load_all) : Server | Nil
Finds a saved server by name, or
nilif none matches. -
.load_all(path : String = DEFAULT_PATH) : Array(Server)
Loads all servers saved at path.
-
.save(server : Server, path : String = DEFAULT_PATH) : Nil
Persists server to path, replacing any existing entry with the same name.
Instance Method Summary
-
#docker_host : String
Builds the
ssh://URL used asDOCKER_HOSTto reach this server. - #host : String
- #name : String
- #port : Int32 | Nil
- #user : String | Nil
Constructor Detail
Class Method Detail
Finds a saved server by name, or nil if none matches.
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).
Persists server to path, replacing any existing entry with the same name.