From 60a10ba069d01627f10f759a500edb1fd40f9563 Mon Sep 17 00:00:00 2001 From: Christian Nunciato Date: Thu, 18 Jan 2018 16:18:17 -0800 Subject: [PATCH] Add some details to the SSH support docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds some prerequisites and explanation to the USAGE doc and makes it work without assuming the presence of a `bin` folder/link in the user’s home directory. Signed-off-by: Christian Nunciato --- tools/ssh_helpers/Usage.md | 29 +++++++++++++++++++++++++++-- tools/ssh_helpers/hab-env | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tools/ssh_helpers/Usage.md b/tools/ssh_helpers/Usage.md index 967ca9c1e3..0804ecf7a3 100644 --- a/tools/ssh_helpers/Usage.md +++ b/tools/ssh_helpers/Usage.md @@ -1,4 +1,29 @@ +# Prerequisites + +These scripts make it easy to connect to running Habitat instances. To use them, you'll need to set up a few things first: + +* Make sure you've downloaded the `habitat-srv-admin` key and placed it at at `~/.ssh/`. +* If you haven't already, create an IAM user for yourself in Habitat AWS. You'll need membership in the `admins` group and programmatic access. Note your generated access key ID and secret. +* Install [the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html) and place it on your PATH. +* Configure the AWS CLI using your Habitat AWS IAM credentials. +* Install [jq](https://stedolan.github.io/jq/). (e.g., `brew install jq`) +* Install [tmux](https://github.com/tmux/tmux/wiki). (e.g., `brew install tmux`) +* Install [tmuxinator](https://github.com/tmuxinator/tmuxinator). (`gem install tmuxinator`) + +# Generating and Updating Configuration + +Once you're set up with the prerequisites listed above, you should be able to generate SSH and tmuxinator configurations using the following commands (executed from within this directory): + ``` -update-habitat-ssh acceptance -hab-env acceptance +./update-habitat-ssh acceptance +./update-habitat-ssh live ``` + +And with that, connect to running environments: + +``` +./hab-env acceptance +./hab-env live +``` + +Any troubles, ask in #core-dev! Enjoy. diff --git a/tools/ssh_helpers/hab-env b/tools/ssh_helpers/hab-env index bffa1e6038..4a8a7de8c5 100755 --- a/tools/ssh_helpers/hab-env +++ b/tools/ssh_helpers/hab-env @@ -9,7 +9,7 @@ SESSION="hab_${HAB_ENV}" # (Re-)generate a tmuxinator session description. This ensures we're # always up-to-date -~/bin/generate-habitat-env-tmuxinator.sh ${HAB_ENV} \ +./generate-habitat-env-tmuxinator.sh ${HAB_ENV} \ > ~/.tmuxinator/${SESSION}.yml # TODO: What if the session is already running?