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


Python Jenkins.delete方法代码示例

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


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

示例1: delete_jobs

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
def delete_jobs(host, jobnames, options):
    """
    Delete existing jobs.
    """
    jenkins = Jenkins(host, auth=get_auth(options))
    for jobname in jobnames:
        print ("Deleting job '{0}'".format(jobname))
        response = jenkins.delete(jobname)
        print(response.status_code)
开发者ID:askedrelic,项目名称:autojenkins,代码行数:11,代码来源:run.py

示例2: delete_job

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
def delete_job(host, jobname):
    """
    Delete an existing job
    """
    print ("Deleting job '{0}'".format(jobname))

    jenkins = Jenkins(host)
    response = jenkins.delete(jobname)
    print('Status: {0}'.format(response.status_code))
开发者ID:pombredanne,项目名称:autojenkins,代码行数:11,代码来源:run.py

示例3: delete_jobs

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
def delete_jobs(host, jobnames):
    """
    Delete existing jobs.
    """
    for jobname in jobnames:
        print ("Deleting job '{0}'".format(jobname))
        jenkins = Jenkins(host)
        response = jenkins.delete(jobname)
        print(response.status_code)
开发者ID:baseblack,项目名称:autojenkins,代码行数:11,代码来源:run.py

示例4: delete_jobs

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
def delete_jobs(host, jobnames, options):
    """
    Delete existing jobs.
    """
    jenkins = Jenkins(host, proxies=get_proxy(options), auth=get_auth(options))
    for jobname in jobnames:
        print ("Deleting job '{0}'".format(jobname))
        try:
            response = jenkins.delete(jobname)
            if response.status_code == 200:
                print("Job '%s' deleted" % jobname)
        except jobs.JobInexistent as error:
            print("Error:", error.msg)
            print("Error:", error.msg)
        except (jobs.HttpForbidden, jobs.HttpUnauthorized):
            pass
开发者ID:ThomasGriffinx,项目名称:autojenkins,代码行数:18,代码来源:run.py

示例5: sorted

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
            datestamp = dateflag.groups()[0]
            #print "Jobname=%-90s Date=%-20s Status=%-10s" % ( jobname, datestamp, jobstatus )
            if jobHash.has_key(datestamp):
                jobHash[datestamp].append(jobname)
            else:
                jobHash[datestamp] = []
                jobHash[datestamp].append(jobname)

    for key in  sorted(jobHash.keys()):
        if cmp(key, "2014-11-08") == 1:
            continue
        print "Date=%-20s " % key
        for job in jobHash[key]:
            print "          %s" % job
            print j.job_url( job )
            j.delete( job )



    print "Size=",len(jobs)


    '''
    for job, color in jobs:
        if color in ['red', 'blue', 'yellow']:
            full_info = j.job_info(job)
            last_build = j.last_build_info(job)
            when = datetime.fromtimestamp(last_build['timestamp'] / 1000)
        else:
            when = '(unknown)'
        print("{0!s:<19} {1:<6} {2}".format(when, color, job))
开发者ID:nuaays,项目名称:AutomateJenkins,代码行数:33,代码来源:demo_run.py

示例6: Jenkins

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [as 别名]
from autojenkins import Jenkins


if __name__ == '__main__':
    j = Jenkins('http://jenkins.pe.local')
    # dir = path.dirname(path.dirname(__file__))
    # config_file = path.join(dir, 'templates/story-dev-job.xml')
    response = j.delete('aaa')
    response = j.create_copy('aaa', 'template',
                             repo='mbf-warehouse-screens',
                             branch='us544_login',
                             package='warehouse_screens')
    print(response.status_code)
    if response.status_code == 200:
        j.build('aaa')
开发者ID:OddBloke,项目名称:autojenkins,代码行数:17,代码来源:test_run.py

示例7: __init__

# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import delete [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.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。