Created
September 10, 2013 05:10
-
-
Save jebberjeb/6505226 to your computer and use it in GitHub Desktop.
start/stop CR3 services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
# paths | |
CONFUSION_ROOT=~/primedia/confusion | |
RANDR_ROOT=~/primedia/randr | |
RNRUI_ROOT=~/primedia/rnr_ui | |
PORTAL_ROOT=~/primedia/portal | |
PROXY_ROOT=~ | |
PROXY_APP=ngrok | |
# start services cd to root some command | |
START_CONFUSION=" cd $CONFUSION_ROOT ; vagrant up" | |
START_RACKUP=" cd $CONFUSION_ROOT ; rackup " | |
START_RANDR=" cd $RANDR_ROOT ; lein ring server-headless 2000" | |
START_PORTAL=" cd $PORTAL_ROOT ; rails s -p 6001" | |
START_PORTAL_PROXY="cd $PROXY_ROOT ; $PROXY_APP 6001" | |
START_RNRUI=" cd $RNRUI_ROOT ; rails s -p 3000" | |
START_RNRUI_PROXY=" cd $PROXY_ROOT ; $PROXY_APP -subdomain=\"jebrr\" 3000" | |
if [ "$1" == "start" ]; then | |
# start tmux | |
SESSION=CR3 | |
TERM=xterm-256color; tmux -2 new-session -d -s $SESSION | |
# start a window for confusion & randr | |
tmux rename-window "CONFUSION & RANDR" | |
tmux split-window -v | |
tmux select-pane -t 0 | |
tmux split-window -h | |
tmux select-pane -t 0 | |
tmux send-keys "$START_RACKUP \"" C-m | |
tmux select-pane -t 1 | |
tmux send-keys "$START_CONFUSION \"" C-m | |
tmux select-pane -t 2 | |
tmux send-keys "$START_RANDR" C-m | |
# start a new window for portal & rnr_ui | |
tmux new-window -t $SESSION:1 -n "PORTAL & RNRUI" | |
tmux split-window -v | |
tmux select-pane -t 0 | |
tmux split-window -h | |
tmux select-pane -t 0 | |
tmux send-keys "$START_PORTAL" C-m | |
tmux select-pane -t 1 | |
tmux send-keys "$START_PORTAL_PROXY" C-m | |
tmux select-pane -t 2 | |
tmux split-window -h | |
tmux select-pane -t 2 | |
tmux send-keys "$START_RNRUI" C-m | |
tmux select-pane -t 3 | |
tmux send-keys "$START_RNRUI_PROXY" C-m | |
tmux att | |
fi | |
if [ "$1" == "stop" ]; then | |
tmux kill-server | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment