You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/08/25 15:50:50 UTC
[whimsy] branch master updated: launch toucher
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 4def694 launch toucher
4def694 is described below
commit 4def6941e0ff988ad68c3db78355f8109011b9b4
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Aug 25 11:50:37 2016 -0400
launch toucher
---
MACOSX.md | 32 +++++++++++++++++++++++++++++++-
config/toucher.plist | 17 +++++++++++++++++
config/toucher.service | 10 ++++++++++
3 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/MACOSX.md b/MACOSX.md
index e050be4..b2c0631 100644
--- a/MACOSX.md
+++ b/MACOSX.md
@@ -2,7 +2,9 @@ Installation on Mac OS/X
========================
Step by step instruction on getting a full whimsy test environment up and
-running on Mac OS/X.
+running on Mac OS/X. Not all steps are required for every tool, but steps
+common to many tools are included here, and additional steps required for
+specific tools are linked at the bottom of these instructions.
Install Homebrew
----------------
@@ -343,6 +345,34 @@ Information on other ways to configure sending mail can be found at
[DEVELOPMENT.md](DEVELOPMENT.md#setup) step 6.
+Make applications restart on change
+-----------------------------------
+
+While CGI scripts and static pages (HTML, CSS, JavaScript) can be changed
+and are immediately available to be served without restarting the server,
+Passenger/Rack applications need to be restarted to pick up changes. To
+make this easier, whimsy has a small tool that will watch for file system
+changes and restart applications that might be affected on the receipt of
+the next request.
+
+To have this tool launch automatically, copy `whimsy/config/toucher.plist` to
+'~/Library/LaunchAgents/'. Edit the paths in the `ProgramArguments` as
+required. And start via:
+
+```
+launchctl load ~/Library/LaunchAgents/toucher.plist
+```
+
+To verify that it is working, touch a file in an application, and verify
+that `tmp/restart.txt` has been updated. Example:
+
+```
+$ ls -l whimsy/www/board/agenda/tmp/restart.txt
+$ touch whimsy/www/board/agenda/README.md
+$ ls -l whimsy/www/board/agenda/tmp/restart.txt
+```
+
+
Additional (application specific) configuration
-----------------------------------------------
diff --git a/config/toucher.plist b/config/toucher.plist
new file mode 100644
index 0000000..6cd8096
--- /dev/null
+++ b/config/toucher.plist
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>org.apache.whimsy/toucher</string>
+
+ <key>ProgramArguments</key>
+ <array>
+ <string>/usr/local/bin/ruby</string>
+ <string>/Users/rubys/git/whimsy/tools/toucher.rb</string>
+ </array>
+
+ <key>KeepAlive</key>
+ <true/>
+</dict>
+</plist>
diff --git a/config/toucher.service b/config/toucher.service
new file mode 100644
index 0000000..6e43f93
--- /dev/null
+++ b/config/toucher.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Restart whimsy applications upon update
+
+[Service]
+User=rubys
+Group=rubys
+ExecStart=/usr/bin/ruby /home/rubys/git/whimsy/tools/toucher.rb
+
+[Install]
+WantedBy=multi-user.target
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].