예제 #1
0
    def run(self, **kwargs):
        logger = self.get_logger(**kwargs)

        try:
            logger.info('updating gitolite..')
            if RepositoryUpdate.objects.filter(is_exported=False).count() > 0:
                from brigitte.repositories.utils import update_gitolite
                update_gitolite()
                RepositoryUpdate.objects.filter(is_exported=False).update(
                    is_exported=True,
                    exported=datetime.now()
                )
                logger.info('updated!')
            else:
                logger.info('no update needed!')
            return True
        except Exception, exc:
            logger.error('failed: %s' % exc)
            self.retry([], kwargs, exc=exc)
            return False
예제 #2
0
 def handle(self, *args, **options):
     update_gitolite()