ControlNode.Release (Control Node v0.1.1) View Source

Link to this section Summary

Functions

Deploys a release to the host specified by host_spec

With the given release_spec, host_spec and cookie tries to connect to the release running on the remote host. In case the release is running on the host a SSH tunnel is established and control node connects to the release (via Node.connect/1) and starts monitoring the release node.

Creates a SSH tunnel to remote service and forwards a local port to the remote service port.

Stops the release running on host_spec

Stops the release node on a given remote host

Stops monitoring the remote release and closes the SSH tunnel to the remote host

Link to this section Functions

Link to this function

connect(release_spec, host_spec, cookie, monitor_node? \\ false)

View Source

Connects to a remote release via Node.connect/1

NOTE: Assumes that a SSH tunnel has been setup to the remote service

Link to this function

deploy(release_spec, host_spec, registry_spec, version)

View Source

Specs

deploy(
  ControlNode.Release.Spec.t(),
  ControlNode.Host.SSH.t(),
  ControlNode.Registry.Local.t(),
  binary()
) :: :ok | {:error, ControlNode.Host.SSH.ExecStatus.t()}

Deploys a release to the host specified by host_spec

NOTE: Prior to calling this function it should be ensured that no release with name release_spec.name is running on host specified by host_spec

Link to this function

initialize_state(release_spec, host_spec, cookie)

View Source

With the given release_spec, host_spec and cookie tries to connect to the release running on the remote host. In case the release is running on the host a SSH tunnel is established and control node connects to the release (via Node.connect/1) and starts monitoring the release node.

Link to this function

setup_tunnel(release_spec, host_spec)

View Source

Specs

setup_tunnel(ControlNode.Release.Spec.t(), ControlNode.Host.SSH.t()) ::
  {:ok, integer()} | {:error, :release_not_running}

Creates a SSH tunnel to remote service and forwards a local port to the remote service port.

NOTE: remote service's port is the one registered with the EPMD service running on the remote host

Link to this function

stop(release_spec, host_spec)

View Source

Specs

Stops the release running on host_spec

Link to this function

terminate(release_spec, state)

View Source

Stops the release node on a given remote host

Link to this function

terminate_state(release_spec, release_state)

View Source

Specs

Stops monitoring the remote release and closes the SSH tunnel to the remote host