当前位置: 首页>>代码示例>>Python>>正文


Python Job.find_job方法代码示例

本文整理汇总了Python中models.Job.find_job方法的典型用法代码示例。如果您正苦于以下问题:Python Job.find_job方法的具体用法?Python Job.find_job怎么用?Python Job.find_job使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Job的用法示例。


在下文中一共展示了Job.find_job方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: finish

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def finish(self, request, pk, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     jjob = JenkinsController().get_job(pk)
     if not jjob:
         return ResponseNotFound("Job '%s' not found on Jenkins" % pk)
     job.build_number = 0
     job.save()
     return ResponseOk(model_to_dict(job))
开发者ID:TerryHowe,项目名称:pogo,代码行数:12,代码来源:views.py

示例2: stop

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def stop(self, request, pk, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     jay = JenkinsController()
     jjob = jay.get_job(pk)
     if not jjob:
         return ResponseNotFound("Job '%s' not found on Jenkins" % pk)
     try:
         jay.stop_build(job)
     except jenkins.JenkinsException as e:
         return ResponseServerError(str(e))
     job.save()
     return ResponseOk(model_to_dict(job))
开发者ID:TerryHowe,项目名称:pogo,代码行数:16,代码来源:views.py

示例3: status

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def status(self, request, pk, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     jay = JenkinsController()
     jjob = jay.get_job(pk)
     if not jjob:
         return ResponseNotFound("Job '%s' not found on Jenkins" % pk)
     try:
         if not job.build_number:
             return ResponseNotFound("Job '%s' doesn't have a current build" % pk)
         build_info = jay.get_build_info(job, job.build_number)
     except jenkins.JenkinsException as e:
         return ResponseServerError(str(e))
     return ResponseOk(build_info)
开发者ID:TerryHowe,项目名称:pogo,代码行数:17,代码来源:views.py

示例4: builds

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def builds(self, request, pk, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     jay = JenkinsController()
     jjob = jay.get_job(pk)
     if not jjob:
         return ResponseNotFound("Job '%s' not found on Jenkins" % pk)
     try:
         job_info = jay.get_job_info(job)
         builds = []
         for build in job_info['builds']:
             builds.append(jay.get_build_info(job, build['number']))
     except jenkins.JenkinsException as e:
         return ResponseServerError(str(e))
     return ResponseOk(builds)
开发者ID:TerryHowe,项目名称:pogo,代码行数:18,代码来源:views.py

示例5: start

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def start(self, request, pk, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     try:
         jay = JenkinsController()
         jjob = jay.get_job(pk)
         if not jjob:
             jay.create_job(job)
         else:
             jay.update_job(job)
         job.build_number = jay.build_job(job)
         if job.build_number:
             job.save()
     except jenkins.JenkinsException as e:
         return ResponseServerError(str(e))
     return ResponseOk(model_to_dict(job))
开发者ID:TerryHowe,项目名称:pogo,代码行数:19,代码来源:views.py

示例6: build_info

# 需要导入模块: from models import Job [as 别名]
# 或者: from models.Job import find_job [as 别名]
 def build_info(self, request, pk, number, format=None):
     job = Job.find_job(pk)
     if not job:
         return ResponseNotFound("Job '%s' not found" % pk)
     jay = JenkinsController()
     jjob = jay.get_job(pk)
     if not jjob:
         return ResponseNotFound("Job '%s' not found on Jenkins" % pk)
     try:
         try:
             number = int(number)
         except ValueError:
             msg = ("Job '%s' does not have a job '%s'" % (pk, number))
             return ResponseNotFound(msg)
         build_info = jay.get_build_info(job, number)
     except jenkins.JenkinsException as e:
         return ResponseServerError(str(e))
     return ResponseOk(build_info)
开发者ID:TerryHowe,项目名称:pogo,代码行数:20,代码来源:views.py


注:本文中的models.Job.find_job方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。