OLD | NEW |
(Empty) | |
| 1 # -*- makefile -*- |
| 2 |
| 3 # This is a simple makefile which lives in a buildmaster/buildslave |
| 4 # directory (next to the buildbot.tac file). It allows you to start/stop the |
| 5 # master or slave by doing 'make start' or 'make stop'. |
| 6 |
| 7 # The 'reconfig' target will tell a buildmaster to reload its config file. |
| 8 |
| 9 # Note that a relative PYTHONPATH entry is relative to the current directory. |
| 10 |
| 11 # On the Mac, the buildbot is started via the launchd mechanism as a |
| 12 # LaunchAgent to give the slave a proper Mac UI environment for tests. In |
| 13 # order for this to work, the plist must be present and loaded by launchd, and |
| 14 # the user must be logged in to the UI. The plist is loaded by launchd at user |
| 15 # login (and the job may have been initially started at that time too). Our |
| 16 # Mac build slaves are all set up this way, and have auto-login enabled, so |
| 17 # "make start" should just work and do the right thing. |
| 18 # |
| 19 # When using launchd to start the job, it also needs to be used to stop the |
| 20 # job. Otherwise, launchd might try to restart the job when stopped manually |
| 21 # by SIGTERM. Using SIGHUP for reconfig is safe with launchd. |
| 22 # |
| 23 # Because it's possible to have more than one slave on a machine (for testing), |
| 24 # this tests to make sure that the slave is in the known slave location, |
| 25 # /b/slave, which is what the LaunchAgent operates on. |
| 26 USE_LAUNCHD := \ |
| 27 $(shell [ -f ~/Library/LaunchAgents/org.chromium.buildbot.master.client.webm.p
list ] && \ |
| 28 [ "$$(pwd -P)" = "/b/build/masters/master.client.webm" ] && \ |
| 29 echo 1) |
| 30 |
| 31 start: |
| 32 ifneq ($(USE_LAUNCHD),1) |
| 33 PYTHONPATH=../../third_party/buildbot_7_12:../../third_party/twisted_8_1
:../../scripts:../../third_party:../../site_config:../../../build_internal/site_
config:. python ../../scripts/common/twistd --no_save -y buildbot.tac |
| 34 else |
| 35 launchctl start org.chromium.buildbot.master.client.webm |
| 36 endif |
| 37 |
| 38 stop: |
| 39 ifneq ($(USE_LAUNCHD),1) |
| 40 if `test -f twistd.pid`; then kill `cat twistd.pid`; fi; |
| 41 else |
| 42 launchctl stop org.chromium.buildbot.master.client.webm |
| 43 endif |
| 44 |
| 45 reconfig: |
| 46 kill -HUP `cat twistd.pid` |
| 47 |
| 48 log: |
| 49 tail -F twistd.log |
| 50 |
| 51 wait: |
| 52 while `test -f twistd.pid`; do sleep 1; done; |
| 53 |
| 54 restart: stop wait start log |
OLD | NEW |