Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # -*- makefile -*- | 1 # -*- makefile -*- |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This should be included by a makefile which lives in a buildmaster/buildslave | 6 # This should be included by a makefile which lives in a buildmaster/buildslave |
| 7 # directory (next to the buildbot.tac file). That including makefile *must* | 7 # directory (next to the buildbot.tac file). That including makefile *must* |
| 8 # define MASTERPATH. | 8 # define MASTERPATH. |
| 9 | 9 |
| 10 # The 'start' and 'stop' targets start and stop the buildbot master. | 10 # The 'start' and 'stop' targets start and stop the buildbot master. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 $(GCLIENT) diff >> actions.log || true | 56 $(GCLIENT) diff >> actions.log || true |
| 57 @($(INFRA_RUNPY) infra.tools.send_monitoring_event \ | 57 @($(INFRA_RUNPY) infra.tools.send_monitoring_event \ |
| 58 --service-event-revinfo=$(CURRENT_DIR)/revinfo.log \ | 58 --service-event-revinfo=$(CURRENT_DIR)/revinfo.log \ |
| 59 --service-event-type=START \ | 59 --service-event-type=START \ |
| 60 --event-mon-run-type=prod \ | 60 --event-mon-run-type=prod \ |
| 61 --event-mon-service-name \ | 61 --event-mon-service-name \ |
| 62 buildbot/master/$(MASTERPATH) \ | 62 buildbot/master/$(MASTERPATH) \ |
| 63 || echo 'Running send_monitoring_event failed, skipping sending events.' \ | 63 || echo 'Running send_monitoring_event failed, skipping sending events.' \ |
| 64 ) 2>&1 | tee -a actions.log | 64 ) 2>&1 | tee -a actions.log |
| 65 endif | 65 endif |
| 66 # There is a race condition between startup and when twistd.pid is writt en. | |
| 67 # Anyone issuing a second `make start` before the twistd.pid is written will | |
| 68 # spawn two masters. This is hopefully unlikely, but a proper solution w ould | |
| 69 # be to use flock (not available on OSX). The critical section contains BOTH | |
| 70 # the twistd start and the wait for the twistd.pid. | |
| 66 @echo 'Now running Buildbot master.' | 71 @echo 'Now running Buildbot master.' |
| 67 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/common/twistd --no_save - y buildbot.tac | 72 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/common/twistd --no_save - y buildbot.tac |
| 73 @echo 'Waiting for creation of twistd.pid...' | |
| 74 while `test ! -f twistd.pid`; do sleep 1; done; | |
|
dsansome
2016/03/18 00:01:57
What if twistd.pid is never created? Does master
| |
| 68 | 75 |
| 69 ifeq ($(BUILDBOT_PATH),$(BUILDBOT8_PATH)) | 76 ifeq ($(BUILDBOT_PATH),$(BUILDBOT8_PATH)) |
| 70 start-prof: bootstrap | 77 start-prof: bootstrap |
| 71 else | 78 else |
| 72 start-prof: | 79 start-prof: |
| 73 endif | 80 endif |
| 74 TWISTD_PROFILE=1 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/common/t wistd --no_save -y buildbot.tac | 81 TWISTD_PROFILE=1 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/common/t wistd --no_save -y buildbot.tac |
| 75 | 82 |
| 76 stop: notify printstep | 83 stop: notify printstep |
| 77 ifndef NO_REVISION_AUDIT | 84 ifndef NO_REVISION_AUDIT |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 104 | 111 |
| 105 last-restart: | 112 last-restart: |
| 106 @if `test -f twistd.pid`; then stat -c %y `readlink -f twistd.pid` | \ | 113 @if `test -f twistd.pid`; then stat -c %y `readlink -f twistd.pid` | \ |
| 107 cut -d "." -f1; fi; | 114 cut -d "." -f1; fi; |
| 108 @ls -t -1 twistd.log* | while read f; do tac $$f | grep -m 1 \ | 115 @ls -t -1 twistd.log* | while read f; do tac $$f | grep -m 1 \ |
| 109 "Creating BuildMaster"; done | head -n 1 | 116 "Creating BuildMaster"; done | head -n 1 |
| 110 | 117 |
| 111 wait: | 118 wait: |
| 112 while `test -f twistd.pid`; do sleep 1; done; | 119 while `test -f twistd.pid`; do sleep 1; done; |
| 113 | 120 |
| 121 waitforstart: | |
| 122 while `test ! -f twistd.pid`; do sleep 1; done; | |
| 123 | |
| 114 restart: notify stop wait start log | 124 restart: notify stop wait start log |
| 115 | 125 |
| 116 restart-prof: stop wait start-prof log | 126 restart-prof: stop wait start-prof log |
| 117 | 127 |
| 118 # This target is only known to work on 0.8.x masters. | 128 # This target is only known to work on 0.8.x masters. |
| 119 upgrade: printstep | 129 upgrade: printstep |
| 120 @[ -e '.dbconfig' ] || [ -e 'state.sqlite' ] || \ | 130 @[ -e '.dbconfig' ] || [ -e 'state.sqlite' ] || \ |
| 121 PYTHONPATH=$(PYTHONPATH) python buildbot upgrade-master . | 131 PYTHONPATH=$(PYTHONPATH) python buildbot upgrade-master . |
| 122 | 132 |
| 123 # This target is only known to be useful on 0.8.x masters. | 133 # This target is only known to be useful on 0.8.x masters. |
| 124 bootstrap: printstep | 134 bootstrap: printstep |
| 125 @[ -e '.dbconfig' ] || [ -e 'state.sqlite' ] || \ | 135 @[ -e '.dbconfig' ] || [ -e 'state.sqlite' ] || \ |
| 126 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/tools/state_create.py \ | 136 PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/tools/state_create.py \ |
| 127 --restore --db='state.sqlite' --txt '../state-template.txt' | 137 --restore --db='state.sqlite' --txt '../state-template.txt' |
| 128 | 138 |
| 129 setup: | 139 setup: |
| 130 @echo export PYTHONPATH=$(PYTHONPATH) | 140 @echo export PYTHONPATH=$(PYTHONPATH) |
| OLD | NEW |