Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a console command #5

Closed
wants to merge 1 commit into from

2 participants

@bronson

I find it handy to be able to

deploy dev01 console

when I want to muck around on the machine to see exactly what's going on.

@tj
Owner
tj commented

good idea! merging

@tj tj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 27, 2011
  1. @bronson

    add the console command

    bronson authored
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 0 deletions.
  1. +14 −0 bin/deploy
View
14 bin/deploy
@@ -33,6 +33,7 @@ usage() {
curr[ent] output current release commit
prev[ious] output previous release commit
exec|run <cmd> execute the given <cmd>
+ console open an ssh session to the host
list list previous deploy commits
[ref] deploy to [ref], the 'ref' setting, or latest tag
@@ -112,6 +113,18 @@ run() {
$shell $@
}
+console() {
+ local url="`config_get user`@`config_get host`"
+ local key=`config_get key`
+ if test -n "$key"; then
+ local shell="ssh -i $key $url"
+ else
+ local shell="ssh $url"
+ fi
+ echo $shell
+ exec $shell
+}
+
#
# Output config or [key].
#
@@ -305,6 +318,7 @@ while test $# -ne 0; do
-C|--chdir) log cd $1; cd $1; shift ;;
-T|--no-tests) TEST=0 ;;
run|exec) require_env; run "cd `config_get path` && $@"; exit ;;
+ console) require_env; console; exit ;;
curr|current) require_env; current_commit; exit ;;
prev|previous) require_env; nth_deploy_commit 2; exit ;;
revert) require_env; revert_to ${1-1}; exit ;;
Something went wrong with that request. Please try again.