Skip to content

Commit

Permalink
Merge pull request #19 from necaris/master
Browse files Browse the repository at this point in the history
Add option to config to ensure ssh allocates a tty
  • Loading branch information
tj committed Feb 14, 2014
2 parents cf12926 + 6a72564 commit 31c0b16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@
Now the deploy script will invoke `ssh -A` when deploying and there's
no need to keep SSH keys on your servers.

### Hooks
### needs_tty

If your deployment scripts require any user interaction (which they shouldn't, but
often do) you'll probably want SSH to allocate a tty for you. Put `needs_tty yes`
in the config section if you'd like the deploy script to invoke `ssh -t` and ensure
you have a tty available.

## Hooks

All hooks are arbitrary commands, executed relative to `path/current`,
aka the previous deployment for `pre-deploy`, and the new deployment
Expand Down
4 changes: 3 additions & 1 deletion bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ ssh_command() {
local key="`config_get key`"
local forward_agent="`config_get forward-agent`"
local port="`config_get port`"
local needs_tty="`config_get needs_tty`"

test -n "$forward_agent" && local agent="-A"
test -n "$key" && local identity="-i $key"
test -n "$port" && local port="-p $port"
echo "ssh $agent $port $identity $url"
test -n "$needs_tty" && local tty="-t"
echo "ssh $tty $agent $port $identity $url"
}

#
Expand Down

0 comments on commit 31c0b16

Please sign in to comment.