SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
НазадМетки: buildbot
During project lifetime worker has transitioned over few states:
buildbot package distribution.buildbot package to buildbot-slave package.buildbot-slave package was renamed to buildbot-worker.Before Buildbot version 0.8.1, the Buildbot master and worker were part of the same distribution. As of version 0.8.1, the worker is a separate distribution.
As of this release, you will need to install buildbot-slave to run a worker.
Any automatic startup scripts that had run buildbot start for previous versions should be changed to run buildslave start instead.
If you are running a version later than 0.8.1, then you can skip the remainder of this section: the upgrade-slave command will take care of this. If you are upgrading directly to 0.8.1, read on.
The existing buildbot.tac for any workers running older versions will need to be edited or replaced. If the loss of cached worker state (e.g., for Source steps in copy mode) is not problematic, the easiest solution is to simply delete the worker directory and re-run buildslave create-slave.
If deleting the worker directory is problematic, the change to buildbot.tac is simple. On line 3, replace:
from buildbot.slave.bot import BuildSlave
with:
from buildslave.bot import BuildSlave
After this change, the worker should start as usual.
0.8.* version of buildbot-slaveIf you have just installed a new version of Buildbot-slave, you may need to take some steps to upgrade it. If you are upgrading to version 0.8.2 or later, you can run
buildslave upgrade-slave /path/to/worker/dir
buildbot-slave to buildbot-workerIf the loss of cached worker state (e.g., for Source steps in copy mode) is not problematic, the easiest solution is to simply delete the worker directory and re-run buildbot-worker create-worker.
If deleting the worker directory is problematic, you can change buildbot.tac in the following way:
Replace:
from buildslave.bot import BuildSlave
	with:
from buildbot_worker.bot import Worker
	Replace:
application = service.Application('buildslave')
	with:
application = service.Application('buildbot-worker')
	Replace:
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
               keepalive, usepty, umask=umask, maxdelay=maxdelay,
               numcpus=numcpus, allow_shutdown=allow_shutdown)
	with:
s = Worker(buildmaster_host, port, slavename, passwd, basedir,
           keepalive, umask=umask, maxdelay=maxdelay,
           numcpus=numcpus, allow_shutdown=allow_shutdown)