2019-02-24 18:24:30 +07:00
|
|
|
#!/usr/bin/python3
|
|
|
|
import logging
|
|
|
|
|
2022-07-07 21:23:01 +07:00
|
|
|
from tools import RunbotClient, run
|
|
|
|
|
2019-02-24 18:24:30 +07:00
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
|
2022-07-07 21:23:01 +07:00
|
|
|
|
2021-11-25 19:22:19 +07:00
|
|
|
class BuilderClient(RunbotClient):
|
2019-02-24 18:24:30 +07:00
|
|
|
|
2021-11-25 19:22:19 +07:00
|
|
|
def on_start(self):
|
2022-06-17 18:52:37 +07:00
|
|
|
for repo in self.env['runbot.repo'].search([('mode', '!=', 'disabled')]):
|
|
|
|
repo._update(force=True)
|
2019-02-24 18:24:30 +07:00
|
|
|
|
2021-11-25 19:22:19 +07:00
|
|
|
def loop_turn(self):
|
|
|
|
if self.count == 1: # cleanup at second iteration
|
|
|
|
self.env['runbot.runbot']._source_cleanup()
|
|
|
|
self.env['runbot.build']._local_cleanup()
|
|
|
|
self.env['runbot.runbot']._docker_cleanup()
|
|
|
|
self.host.set_psql_conn_count()
|
|
|
|
self.host._docker_build()
|
2022-06-15 21:29:33 +07:00
|
|
|
self.env['runbot.repo']._update_git_config()
|
|
|
|
self.git_gc()
|
2021-11-25 19:22:19 +07:00
|
|
|
return self.env['runbot.runbot']._scheduler_loop_turn(self.host)
|
2019-02-24 18:24:30 +07:00
|
|
|
|
2019-12-19 19:56:22 +07:00
|
|
|
|
2019-02-24 18:24:30 +07:00
|
|
|
if __name__ == '__main__':
|
2021-11-25 19:22:19 +07:00
|
|
|
run(BuilderClient)
|