Skip to content

Instantly share code, notes, and snippets.

@justinabrahms
Created December 15, 2015 14:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinabrahms/535c568b8081645770c7 to your computer and use it in GitHub Desktop.
Save justinabrahms/535c568b8081645770c7 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Originally from https://gist.github.com/dmkash/2355219
SESSION_NAME="ccxcon"
cd ~/src/github.com/mitodl/ccxcon
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
# Create the session
tmux new-session -s ${SESSION_NAME} -n docker -d
# tp-docker && ccx-docker (1)
tmux send-keys -t ${SESSION_NAME}:1 'docker-compose up' C-m
tmux split-window -v -t ${SESSION_NAME}:1
tmux send-keys -t ${SESSION_NAME}:1.1 'cd ../teachersportal/ && docker-compose up' C-m
# First window (2) -- emacs
tmux new-window -n emacs -t ${SESSION_NAME}
tmux send-keys -t ${SESSION_NAME} 'emacsclient -t' C-m
# ccx-shell (3)
tmux new-window -n ccxcon.sh -t ${SESSION_NAME}
tmux send-keys -t ${SESSION_NAME} 'git status' C-m
# tp-shell (4)
tmux new-window -n tp.sh -t ${SESSION_NAME}
tmux send-keys -t ${SESSION_NAME} 'cd ../teachersportal/ && git status' C-m
# edx-runserver
tmux new-window -n edx:runserver -t ${SESSION_NAME}
tmux send-keys -t ${SESSION_NAME} 'cd ../../edx/edx-platform/ && vagrant ssh && sudo su edxapp && paver run_all_servers --fast'
# edx
tmux new-window -n edx -t ${SESSION_NAME}
tmux send-keys -t ${SESSION_NAME} 'cd ../../edx/edx-platform/ && git status'
# Start out on the first window when we attach
tmux select-window -t ${SESSION_NAME}:2
fi
tmux attach -t ${SESSION_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment