summaryrefslogtreecommitdiff
path: root/_posts/2012-08-07-opentox-development-in-tmux.md
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-08-07 15:42:47 +0200
committerChristoph Helma <helma@in-silico.ch>2012-08-07 15:42:47 +0200
commitc9e4c80e4476360cda2df896ccdb3cf0f072bf2b (patch)
treec19f5b89499c2fa170bde2b9ebfbbb46956afb79 /_posts/2012-08-07-opentox-development-in-tmux.md
parent4314a36215e58b15c8b462b8bda55b85299d8ca0 (diff)
tmux development added
Diffstat (limited to '_posts/2012-08-07-opentox-development-in-tmux.md')
-rw-r--r--_posts/2012-08-07-opentox-development-in-tmux.md54
1 files changed, 54 insertions, 0 deletions
diff --git a/_posts/2012-08-07-opentox-development-in-tmux.md b/_posts/2012-08-07-opentox-development-in-tmux.md
new file mode 100644
index 0000000..fa11f5c
--- /dev/null
+++ b/_posts/2012-08-07-opentox-development-in-tmux.md
@@ -0,0 +1,54 @@
+---
+layout: post
+title: "Opentox development in tmux"
+description: ""
+category: general
+tags: [development]
+---
+{% include JB/setup %}
+
+The following script starts each opentox service in a separate tmux window and provides separate windows for editing and testing - kind of a IDE for opentox and very useful for debugging.
+
+
+ #!/bin/sh
+
+ # kill/restart services
+ killall unicorn
+ pkill 4s-httpd
+ pkill 4s-backend
+ sudo /etc/rc.d/avahi-daemon restart
+ 4s-backend opentox
+
+ cd ~/opentox
+ # create a new session and detach from it
+ tmux new-session -d -s opentox -n '4s-httpd -p 8080 -D opentox'
+
+ # tmux configuration
+ tmux set set-remain-on-exit on
+ tmux bind r respawn-window
+
+ # start services
+ cd ~/opentox/task
+ pwd && git pull
+ tmux new-window -n 'task' 'unicorn -p 8081'
+ cd ~/opentox/feature
+ pwd && git pull
+ tmux new-window -n 'feature' 'unicorn -p 8082'
+ cd ~/opentox/dataset
+ pwd && git pull
+ tmux new-window -n 'dataset' 'unicorn -p 8083'
+ cd ~/opentox/toxbank-investigation
+ pwd && git pull
+ tmux new-window -n 'investigation' 'unicorn -p 8084'
+ cd ~/opentox/model
+ pwd && git pull
+ tmux new-window -n 'model' 'unicorn -p 8085'
+ cd ~/opentox/opentox-test
+ pwd && git pull
+ tmux new-window -n 'test'
+ cd ~/opentox
+ tmux new-window -n 'work'
+ tmux select-window -t :6
+ tmux -2 attach-session
+
+Tip: To restart a service move to the corresponding window (`Ctrl-b $window_id`), kill the service (`Ctrl-c`) and respawn the window (`Ctrl-b r`).