Created
July 16, 2015 14:54
-
-
Save wkf/a3b267cd8f3c2b55380a to your computer and use it in GitHub Desktop.
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
(prodigy-define-service | |
:name "Bunsen Web" | |
:command "/Users/will/Dropbox/Projects/Bunsen/web/node_modules/.bin/roots" | |
:args '("watch" "--no-open") | |
:cwd "/Users/will/Dropbox/Projects/Bunsen/web" | |
:tags '(bunsen) | |
:env '(("PORT" "8081")) | |
:kill-signal 'sigkill) | |
(prodigy-define-service | |
:name "Bunsen HAProxy" | |
:command "haproxy" | |
:args '("-db" "-f" "haproxy.cfg") | |
:cwd "/Users/will/Dropbox/Projects/Bunsen/haproxy" | |
:tags '(bunsen) | |
:env '(("WEB_SERVER" "127.0.0.1:8081") | |
("API_SERVER" "127.0.0.1:3000") | |
("RIEMANN_SERVER" "127.0.0.1:5556") | |
("BEAKER_SERVER" "192.168.59.103:8801")) | |
:kill-signal 'sigkill) | |
(defun my-prodigy-running-services () | |
(remove-if-not (lambda (service) | |
(eq (plist-get service :status) | |
'running)) | |
prodigy-services)) | |
(add-hook 'kill-emacs-query-functions | |
(lambda () | |
(let ((running-prodigy-services (my-prodigy-running-services))) | |
(when running-prodigy-services | |
(when (y-or-n-p "Kill prodigy services? ") | |
(dolist (service running-prodigy-services) | |
(prodigy-stop-service service) | |
;; TODO: wait for services to actually stop | |
(sleep-for 5))))) | |
t))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment