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


Python Jenkins.get_config_xml方法代码示例

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


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

示例1: Jenkins

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import get_config_xml [as 别名]
__author__ = 'Dmitry'
import jenkins
j = jenkins.Jenkins('http://tdw-deploy-tool.dbdc.luxoft.com:8080/jenkins/')
j.get_jobs()
j.create_job('empty', jenkins.EMPTY_CONFIG_XML)



from autojenkins import Jenkins
j = Jenkins('http://tdw-deploy-tool.dbdc.luxoft.com:8080/jenkins/')
j.get_config_xml('Test-run')

j = Jenkins('http://jenkins.pe.local')
开发者ID:melaz,项目名称:python-learn,代码行数:15,代码来源:jenkins.py

示例2: __init__

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import get_config_xml [as 别名]
class jenkins:
    def __init__(self):
        self.jenkins_url = jenkins_config.get('url')
        self.user = jenkins_config.get('user')
        self.password = jenkins_config.get('password')
        if self.jenkins_url is not None:
            try:
                self.jenkins = Jenkins(
                    self.jenkins_url, auth=(self.user, self.password))
            except Exception as e:
                log_error(e)

    def help(self, req, resp):
        h = '''
                                jenkins CI

                    ops jenkins create_copy -j job -t template -r repo -b branch -p package

                    ops jenkins result -j job
                    ops jenkins info -t template
                    ops jenkins build -j job

                    ops jenkins enable -j job
                    ops jenkins disable -j job
                    ops jenkins delete -j job
        '''
        return h

    def result(self, req, resp):
        job = req.get_param(name='j')
        if job is None:
            return '-j(job) need'
        return self.jenkins.last_result(job)['result']

    def info(self, req, resp):
        template = req.get_param(name='t')
        if template is None:
            return '-t(template) need'
        return self.jenkins.get_config_xml(template)

    def create_copy(self, req, resp):
        job = req.get_param(name='j')
        template = req.get_param(name='t')
        repo = req.get_param(name='r')
        branch = req.get_param(name='b')
        package = req.get_param(name='p')
        if job is None:
            return '-j(job) need'
        if template is None:
            return '-t(template) need'
        if repo is None:
            return '-r(repo) need'
        if branch is None:
            return '-b(branch) need'
        if package is None:
            return '-p(package) need'
        return self.jenkins.create_copy(
            job, template, repo=repo, branch=branch, package=package)

    def build(self, req, resp):
        job = req.get_param(name='j')
        if job is None:
            return '-j(job) need'
        return self.jenkins.build(job)

    def enable(self, req, resp):
        job = req.get_param(name='j')
        if job is None:
            return '-j(job) need'
        return self.jenkins.enable(job)

    def disable(self, req, resp):
        job = req.get_param(name='j')
        if job is None:
            return '-j(job) need'
        return self.jenkins.disable(job)

    def delete(self, req, resp):
        job = req.get_param(name='j')
        if job is None:
            return '-j(job) need'
        return self.jenkins.delete(job)
开发者ID:xiaomatech,项目名称:ops,代码行数:84,代码来源:jenkins.py


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