# Own modules
from fb_tools.common import pp
+from fb_tools.handler.lock import LockHandler
from . import __version__
def __init__(self, appname=None, base_dir=None, verbose=0, version=__version__):
"""Constructor."""
+ self.locker = None
+
description = _(
'Receives push events as JSON-Data and '
'synchronizes the local repository.')
super(WebhookDeployApp, self).post_init()
+ self.locker = LockHandler(
+ appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
+ simulate=self.simulate, sudo=False, quiet=self.quiet,
+ lockretry_delay_start=0.5, lockretry_delay_increase=0.5,
+ lockretry_max_delay=30, max_lockfile_age=900, locking_use_pid=True,
+ lockdir='/tmp')
+
+ self.locker.initialized = True
+
self.initialized = True
# -------------------------------------------------------------------------
if 'branch' in cfg and cfg['branch']:
branch = cfg['branch']
+ lockfile = 'deploy.' + pname + '.lock'
+ LOG.info(_("Trying to create lockfile {fn!r} in directory {d!r} ...").format(
+ fn=lockfile, d=str(self.locker.lockdir)))
+
LOG.info(_("Deploying working directory {f!r} for project {p!r} ...").format(
f=full_path, p=full_name))