Sha256: cee7a9f04148650180cb4ad4e3f91ac9c1c37976e935c2e9f03e9096b2d21cb3

Contents?: true

Size: 919 Bytes

Versions: 3

Compression:

Stored size: 919 Bytes

Contents

#!/bin/bash

#/ NAME
#/     remote -- connects to a remote server
#/
#/ SYNOPSIS
#/     remote hostname ... any ssh args

# figure out the project root under which bin, lib live
shome="$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)"

# load a jason bourne library
source "$shome/libexec/_treadstone" "$@"
get_started

# entry point
function main {
  if [[ "$#" = 0 ]]; then
    logger_fatal "need a hostname or podname"
    exit 1
  fi

  local nm_component="$1"; shift
  local deploy_base="$(ryaml $shome/config/deploy.yml deploy_base)"
  if [[ -n "$deploy_base" ]]; then
    local pod_shortcut="$(ryaml $HOME/.getting-started/config/pods.yml pods ${deploy_base}${nm_component} pod)"
    if [[ -n "$pod_shortcut" ]]; then
      nm_component="${deploy_base}${nm_component}"
    fi
  fi

  exec ssh "$nm_component" "$@"
  logger_fatal "could not execute ssh; this is abnormal"
  exit 1
}

require sub "$BASH_SOURCE" "$@"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alpha_omega-1.3.3 libexec/aoh-remote
alpha_omega-1.3.2 libexec/aoh-remote
alpha_omega-1.3.1 libexec/aoh-remote