Exemplo n.º 1
0
    def __init__(self, git_command):
        self.repo = LocalRepository(Env.get('app_dir'), command = git_command)

        remote_name = 'origin'
        remote = self.repo.getRemoteByName(remote_name)
        if self.old_repo in remote.url:
            log.info('Changing repo to new github organization: %s -> %s', (self.old_repo, self.new_repo))
            new_url = remote.url.replace(self.old_repo, self.new_repo)
            self.repo._executeGitCommandAssertSuccess("remote set-url %s %s" % (remote_name, new_url))
Exemplo n.º 2
0
    def __init__(self):

        self.repo = LocalRepository(Env.get('app_dir'))

        fireEvent('schedule.interval', 'updater.check', self.check, hours=6)

        addEvent('app.load', self.check)

        addApiView('updater.info', self.getInfo)
        addApiView('updater.update', self.doUpdateView)
Exemplo n.º 3
0
    def start(self):
        self.basePath = cherrypy.config['basePath']
        self.runPath = cherrypy.config['runPath']
        self.cachePath = cherrypy.config['cachePath']
        self.isFrozen = cherrypy.config['frozen']
        self.debug = cherrypy.config['debug']
        self.updatePath = os.path.join(self.cachePath, 'updates')
        self.historyFile = os.path.join(self.updatePath, 'history.txt')

        self.repo = LocalRepository(self.basePath)

        # get back the .git dir
        if self.hasGit() and not self.isRepo():
            try:
                log.info('Updating CP to git version.')
                path = os.path.join(self.cachePath, 'temp_git')
                self.removeDir(path)
                repo = LocalRepository(path)
                repo.clone(self.git)
                self.replaceWith(path)
                self.removeDir(path)
            except Exception, e:
                log.error('Trying to rebuild the .git dir: %s' % e)
Exemplo n.º 4
0
 def __init__(self, git_command):
     self.repo = LocalRepository(Env.get('app_dir'), command = git_command)