public
Description: bash scripts, aliases, other misc things go here
Homepage: http://opensource.thinkrelevance.com
Clone URL: git://github.com/relevance/etc.git
etc / bash / deploy.sh
100644 20 lines (16 sloc) 0.733 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Aliases for getting around on a deployed production/staging Rails server.
 
if [ -z "${PROJECT_DIR}" ]; then
  echo "You must define PROJECT_DIR in ~/.bash_profile for this to work."
fi
 
# TODO add support and autodetection for /data root, maybe the /u root, and allowing user to override the root
PROJECT_ROOT="/var/www/domains/${PROJECT_DIR}/www/app"
PROJECT_CURRENT="${PROJECT_ROOT}/current"
PROJECT_SHARED="${PROJECT_ROOT}/shared"
 
if [ -d "$PROJECT_CURRENT" ]; then
alias current="cd ${PROJECT_CURRENT}"
  alias shared="cd ${PROJECT_SHARED}"
  alias logs="cd ${PROJECT_SHARED}/log"
  alias sc="cd ${PROJECT_CURRENT} && script/console"
else
echo "$PROJECT_CURRENT doesn't exist - not creating handy deploy box aliases."
fi