示例#1
0
 def on_commits(self, message=None):
     wi = Deployer(project_id=self.room)
     if 'branch' not in message:
         emit('commits', {
             'event': 'error',
             'data': {
                 'message': 'invalid branch'
             }
         },
              room=self.room)
     else:
         try:
             commits = wi.list_commit(message['branch'])
             emit('commits', {
                 'event': 'commits',
                 'data': commits
             },
                  room=self.room)
         except Exception as e:
             emit('commits', {
                 'event': 'error',
                 'data': {
                     'message': e.message
                 }
             },
                  room=self.room)
示例#2
0
 def on_commits(self, message):
     wi = Deployer(task_id=self.room)
     if 'branch' not in message:
         emit('commits', {'event': 'error:commits', 'data': {'message': 'invalid branch'}}, room=self.room)
     else:
         commits = wi.list_commit(message['branch'])
         emit('repo', {'event': 'repo:branches', 'data': commits}, room=self.room)
示例#3
0
 def on_commits(self, message=None):
     wi = Deployer(project_id=self.room)
     if 'branch' not in message:
         emit('commits', {'event': 'error', 'data': {'message': 'invalid branch'}}, room=self.room)
     else:
         try:
             commits = wi.list_commit(message['branch'])
             emit('commits', {'event': 'commits', 'data': commits}, room=self.room)
         except Exception as e:
             emit('commits', {'event': 'error', 'data': {'message': e.message}}, room=self.room)
示例#4
0
文件: repo.py 项目: coco413/walle-web
    def commits(self, project_id):
        """
        fetch project list or one item
        /tag/

        :return:
        """
        branch = request.args.get('branch', '')
        wi = Deployer(project_id=project_id)
        commits = wi.list_commit(branch)

        return self.render_json(data={
            'branches': commits,
        })
示例#5
0
    def commits(self, project_id):
        """
        fetch project list or one item
        /tag/

        :return:
        """
        branch = request.args.get('branch', '')
        wi = Deployer(project_id=project_id)
        commits = wi.list_commit(branch)

        return self.render_json(data={
            'branches': commits,
        })
示例#6
0
    def commits(self, project_id):
        """
        fetch project list or one item
        /tag/

        :return:
        """
        current_app.logger.info('args----------------')
        current_app.logger.info(project_id)
        current_app.logger.info(request.args)
        branch = request.args.get('branch', '')
        wi = Deployer(project_id=project_id)
        commits = wi.list_commit(branch)

        return self.render_json(data={
            'commits': commits,
        })