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


Python Jenkins.job_exists方法代码示例

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


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

示例1: __init__

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
class TaskBuilder:

  def __init__(self, jenkinsURL):
    self.j = Jenkins(jenkinsURL)
    self.jobName = ""
    #with open("config.xml") as file:
    with open("./builds/config/job/config.xml") as file:
      self.templateConfig = file.read()
    self.template = Template(unicode(self.templateConfig))

  def set_new_config(self, **params):
    self.newConfig = self.template.render(repos=params['repos'], description=params['repos'])

  def add_build(self, **params):
    self.set_job_name(**params)
    self.set_new_config(**params)

    if self.j.job_exists(self.jobName):
      self.do_build(**params)
    else:
      
      self.j.create_job(self.jobName, self.newConfig)
      self.do_build(**params)

  def do_build(self, **params):
    self.set_job_name(**params)
    self.set_new_config(**params)

    self.j.enable_job(self.jobName)
    self.j.build_job(self.jobName, {'branch': params['branch'], 'version': params['version'], 'author': params['author'], \
      'styleguide_repo': params['styleguide_repo'], 'styleguide_branch': params['styleguide_branch'], 'sidecar_repo': params['sidecar_repo'], \
      'sidecar_branch': params['sidecar_branch'], 'package_list': params['package_list'], 'upgrade_package': params['upgrade_package']})
  
  def set_job_name(self,**params):
    buildUtil = BuildUtil()
    self.jobName = buildUtil.get_job_name(repos=params['repos'])

  def get_build_status(self, jobName):
    #job_info = self.j.get_job_info(self.jobName)
    #return build_status
    color_status = {"aborted":"Aborted",  "red": "Failed", "blue": "Succcess"}
    if jobName == "":
      print "Have to specify job name"
      return False
    else:
      if self.j.job_exists(jobName):
        #Job exist in the job list
        job_info = self.j.get_job_info(jobName)

        if color_status.has_key(job_info['color']):
          return color_status[job_info['color']]
        else:
          return 'Running'
      else:
        print "Have to specify a validate job name"
        return False

  def get_job_name(self):
    return self.jobName
开发者ID:NALSS,项目名称:BranchBuilder,代码行数:61,代码来源:buildutil.py

示例2: get_job_name

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
def get_job_name(adaptation_release):
  tmp = 'adaptations_trunk_' + adaptation_release +'_ris'
  jenkins = Jenkins_Url(URL,USER,PASS)
  if jenkins.job_exists(tmp):
    return tmp
  tmp = 'adaptation_trunk_' + adaptation_release +'_ris'
  if jenkins.job_exists(tmp):
    return tmp
  print "Jenkins doesn't exist: " + tmp
  log("FAILED"," jenkins name dosen't exits " + tmp)
  return 0
开发者ID:Maginx,项目名称:git_home,代码行数:13,代码来源:get_jenkins_names.py

示例3: generate_jenkins

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
def generate_jenkins(release):
	jenkins = Jenkins_Url(URL,USER,PASS)
	trunk = trunk_jenkins(release)
	if jenkins.job_exists(trunk):
	  log("trunk","https://eslinv70.emea.nsn-net.net:8080/job/" + trunk)
	else:
		log("failed","trunk " + release)

	n15_5 = n15_5_jenkins(release)
	if jenkins.job_exists(n15_5):
	  log("n15.5","https://eslinv70.emea.nsn-net.net:8080/job/" + n15_5)
	else:
		log("failed","n15.5 " + release)

	n16 = n16_jenkins(release)
	if jenkins.job_exists(n16):
	  log("n16","https://eslinv70.emea.nsn-net.net:8080/job/" + n16)
	else:
		log("failed","n16 " + release)
开发者ID:Maginx,项目名称:git_home,代码行数:21,代码来源:get_jenkins_names.py

示例4: create_jenkins_job

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
def create_jenkins_job(init_job_config, job_name):
    """
    Create new job by getting config file 
    from existing job
    """

    j = Jenkins("http://localhost:8080")

    str_config = j.get_job_config(init_job_config)

    if j.job_exists(job_name) == False:
        j.create_job(job_name, str_config)
开发者ID:Adilla,项目名称:oudjat,代码行数:14,代码来源:auto_jenkins.py

示例5: get_job_name

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
def get_job_name(adaptation_release):
    tmp = 'adaptations_trunk_' + adaptation_release +'_ris'
    jenkins = Jenkins_Url(URL,USER,PASS)
    if jenkins.job_exists(tmp):
        return tmp
    tmp = 'adaptation_trunk_' + adaptation_release +'_ris'
    if jenkins.job_exists(tmp):
        return tmp
    if adaptation_release.__contains__("com.nsn."):
        tmp = 'adaptations_trunk_' + adaptation_release.split('com.nsn.')[-1] +'_ris'
        if jenkins.job_exists(tmp):
            return tmp
    if adaptation_release.__contains__("com.nokia."):
        tmp = 'adaptations_trunk_' + adaptation_release.split('com.nokia.')[-1] +'_ris'
        if jenkins.job_exists(tmp):
            return tmp
    if adaptation_release.__contains__("com.nokianetworks."):
        tmp = 'adaptations_trunk_' + adaptation_release.split('com.nokianetworks.')[-1] +'_ris'
        if jenkins.job_exists(tmp):
            return tmp
    print "Jenkins doesn't exist: " + tmp
    return 0
开发者ID:Maginx,项目名称:git_home,代码行数:24,代码来源:get_fm_adaptations.py

示例6: configure

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
 def configure(self):
     #self.logger.info("setting jenkins authentication method to use unix userdata")
     #self.checkForSuccess(bash("cp %s/jenkis_auth_file /var/lib/jenkins"%currentDir))
     #self.logger.info("setting jenkins password")
     #self.logger.info("echo %s | sudo passwd jenkins --stdin"%self.jenkinsPasswd)
     #self.checkForSuccess(bash("service jenkins restart"))
     time.sleep(10)
     self.logger.info("checking if auth config is successful")
     j=Jenkins(self.jenkinsUrl, "admin", self.jenkinsPasswd)
     try:
        j.get_plugins()
     except Exception as e:
        self.logger.info("failed to retrive plugin info, may be auth problem")
        self.logger.exception(e) 
        raise e
     self.logger.info("auth config successful")
     self.logger.info("installing requried plugins")
     self.logger.info("reading from jenkins plugins file %s/jenkins_plugins.txt"%currentDir)
     f=open('%s/jenkins_plugins.txt'%currentDir, 'r')
     pluginsToInstall=f.read()  
     pluginsToInstall=pluginsToInstall.split('\n')
     self.installPlugins(j,pluginsToInstall)
     self.logger.info("Plugin installation complete")
     self.logger.info("restarting jenkins")
     self.restartJenkins()
     self.logger.info("Creating CI jobs on jenkins")
     for file in os.listdir(os.path.join(currentDir,'jenkins_job_templates')):
       try:
          if not j.job_exists(file):
             f=open(os.path.join(currentDir,'jenkins_job_templates',file),'r')
             config=f.read()
             f.close()
             self.logger.info("creating job %s, reading config from file %s"%(repr(file),os.path.join(currentDir,'jenkins_job_templates',file)))
             j.create_job(file, config)  
          else:
            self.logger.info("job %s already exists, not creating"%file)
       except Exception as e:
            self.logger.warn("failed to create job %s"%(file))
            self.logger.exception(e) 
     self.logger.info("created all CI jobs")
     self.logger.info("Adding driverVM as node in jenkins")
     params = {
              'port': '22',
              'username': 'jenkins',
              'credentialsId':'abe3f139-77bd-4db4-824b-1c79d5205d8b',
              'host':self.config['nodes']['driverVM']['ip'] 
     }
     self.addPasswdToCredential(j,"vagrant")
     self.checkForSuccess(bash("cp %s /var/lib/jenkins/."%(os.path.join(currentDir,"jenkins_credentials","credentials.xml"))))
     j.create_node('driverVM', numExecutors=20, nodeDescription="CI slave VM", remoteFS='/automation/jenkins', labels='driverVM', exclusive=True,launcher=jenkins.LAUNCHER_SSH, launcher_params=params) 
     self.logger.info("jenkins install complete")
开发者ID:bvbharatk,项目名称:CI-orchestrator,代码行数:53,代码来源:configure_jenkins.py

示例7: run

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
    def run(self):
        # Run the egg_info step to find our VCS url.
        self.run_command('egg_info')
        if not self.distribution.metadata.url:
            log.warn("This package does not appear to be in any repository, "
                     "aborting.")
            sys.exit(1)

        # Pull down Jenkins package
        base.fetch_build_eggs(['python-jenkins'], dist=self.distribution)
        from jenkins import Jenkins
        server = CONFIG.jenkins_url
        log.info("Connecting to Jenkins at %s" % server)

        jenkins = Jenkins(server, self.username, self.password)
        name = self.distribution.metadata.name

        if (self.matrix):
            log.info("Matrix job")
            if CONFIG.jenkins_matrix_job_xml:
                path, fname = CONFIG.jenkins_matrix_job.split(':')
            else:
                path, fname = None, 'jenkins_job_matrix.xml'
        else:
            log.info("Non-matrix job - use \'--matrix\' option for matrix builds")
            if CONFIG.jenkins_job_xml:
                path, fname = CONFIG.jenkins_job.split(':')
            else:
                path, fname = None, 'jenkins_job.xml'

        with open(base.get_resource_file(fname, path)) as f:
            jenkins_config_xml = Template(f.read())

        cfg_xml = jenkins_config_xml.safe_substitute(
            name=cgi.escape(name),
            hyphen_escaped_name=cgi.escape(name).replace("-", "?").replace("_", "?"),
            description=cgi.escape(self.distribution.metadata.description),
            repository=self.distribution.metadata.url,
            email=self.distribution.metadata.author_email,
            python_string_xml=self._construct_string_values(self._get_active_python_versions()),
            virtualenv=CONFIG.virtualenv_executable,
            username=self.username
        )

        if jenkins.job_exists(name):
            log.error("Job found at %s/job/%s Please delete this before creating a new one." % (server, name))
        else:
            if (not self.dry_run):
                log.info("Creating job at %s/job/%s" % (server, name))
                jenkins.create_job(name, cfg_xml)
开发者ID:agiledata,项目名称:pkglib,代码行数:52,代码来源:jenkins_.py

示例8: run

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
    def run(self):
        # Run the egg_info step to find our VCS url.
        self.run_command('egg_info')
        if not self.distribution.metadata.url:
            print "This package does not appear to be in any repository, aborting."
            sys.exit(1)

        # Pull down jenkins package
        self.fetch_build_eggs(['python_jenkins'])

        from jenkins import Jenkins

        print "Connecting to Jenkins at %s" % self.server

        # Prompt for password or use command-line
        if self.no_prompt:
            if self.password is None:
                print "Must specify password if no-prompt is set."
                sys.exit(1)
            password = self.password
        else:
            password = getpass.getpass("Please enter your Jenkins password: ")

        jenkins = Jenkins(self.server, self.username, password)
        name = self.distribution.metadata.name
        cfg_xml = JENKINS_CFG_XML.safe_substitute(
                name=name,
                description=self.distribution.metadata.description,
                repository=self.distribution.metadata.url,
                email=self.distribution.metadata.author_email,
                virtualenv=CONFIG.virtualenv_executable,
        )
        if jenkins.job_exists(name):
            if not self.no_prompt:
                while True:
                    user_input = raw_input("Job already exists, update configuration? [y/n]")
                    if not user_input in ('y', 'n'):
                        continue
                    break
                if user_input == 'n':
                    return

            print "Reconfiguring job at %s/job/%s" % (self.server, name)
            jenkins.reconfig_job(name, cfg_xml)
        else:
            print "Creating job at %s/job/%s" % (self.server, name)
            jenkins.create_job(name, cfg_xml)
开发者ID:NunoEdgarGub1,项目名称:pkglib,代码行数:49,代码来源:jenkins.py

示例9: __init__

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
class TaskBuilder:

	def __init__(self, jenkinsURL):
		self.j = Jenkins(jenkinsURL)
		self.jobName = ""
		with open("config.xml") as file:
			self.templateConfig = file.read()
		self.template = Template(unicode(self.templateConfig))

	def set_new_config(self, **params):
		self.newConfig = self.template.render(repos=params['repos'], description=params['repos'])

	def add_build(self, **params):
		self.set_job_name(**params)
		self.set_new_config(**params)

		if self.j.job_exists(self.jobName):
			self.do_build(**params)
		else:
			self.j.create_job(self.jobName, self.newConfig)
			self.do_build(**params)
	
	def do_build(self, **params):
		self.set_job_name(**params)
		self.set_new_config(**params)

		self.j.enable_job(self.jobName)
		self.j.build_job(self.jobName, {'branch': params['branch'], 'version': params['version'], 'package_list': params['package_list']})
	
	def set_job_name(self,**params):
		buildUtil = BuildUtil()
		self.jobName = buildUtil.get_job_name(repos=params['repos'])

	def get_build_status(self, **params):
		#job_info = self.j.get_job_info(self.jobName)
		#return build_status
		pass

	def get_job_name(self):
		return self.jobName
开发者ID:NALSS,项目名称:BranchBuilder-1,代码行数:42,代码来源:buildutil.py

示例10: execOnJenkins

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
    def execOnJenkins(self, env, testSpecifierString, mailto, reRunFailedTests=True, retryCount=1, report=True, execOnOneZone=True,
           postOnPr=False, testMgr=None, avoidZones=None):
        try:
            env['hypervisor'] = ''
            if avoidZones is None:
               avoidZones=[]
            if testMgr is None:
               testMgr = testManager(testSpecifierString, env['virtenvPath'])
            jobModifier = modifyJOb()
            modifiedjob = ''
            j = Jenkins('http://jenkins-ccp.citrix.com', 'bharatk', 'BharatK')
            tests = testMgr.getTests()
            if tests == None:
                raise Exception('found no tests to run')
            while tests is not None:
                os.chdir(env['virtenvPath'])
                self.logger.info('launching jenkins TestExecutor Job')
                cscfg = configGenerator.getSetupConfig(env['config_file'])
                for zone in cscfg.zones:
                    if zone.name in avoidZones:
                       continue
                    for pod in zone.pods:
                        for cluster in pod.clusters:
                            for modifiedjob in jobModifier.addTests(env['build_number'], tests, self.throttle_job_count):
                                file = open('/root/cloud-autodeploy2/newcode/' + modifiedjob, 'r')
                                config = file.read()
                                file.close()
                                bash('rm -f /root/cloud-autodeploy2/newcode/%s' % modifiedjob)
                                if not j.job_exists(modifiedjob):
                                    j.create_job(modifiedjob, config)
                                else:
                                    j.delete_job(modifiedjob)
                                    j.create_job(modifiedjob, config)
                                j.build_job(modifiedjob, {'BASEDIR': env['virtenvPath'],
                                 'MGMT_SVR': env['hostip'],
                                 'buildNumber': env['build_number'],
                                 'zoneName': zone.name,
                                 'hypervisor': cluster.hypervisor.lower(),
                                 'zoneType': zone.networktype,
                                 'configFileName': env['config_file'],
                                 'token': 'bharat'})
                                self.waitForJobComplete(env['virtenvPath'], [zone.name])
                                env['hypervisor'] = '%s,%s' % (env['hypervisor'], cluster.hypervisor.lower())

                            break

                        break

                    if execOnOneZone:
                        break

                tests = testMgr.getTests()

            j.delete_job(modifiedjob)

            reportAnalyserMap=self.getReportAnalysers(cscfg, env, execOnOneZone)  
            if(reRunFailedTests):
               while retryCount > 0:
                     self.logger.info("checking if we need to re run any of the tests")
                     testsToReRun=[]
                     for key in reportAnalyserMap.keys():
                         tests=reportAnalyserMap[key].suitsToRerun
                         if(tests is None):
                            avoidZones.append(key)
                         else:
                            testMgr.addTestsToReRun(tests) 
                     retryCount-=1
                     self.logger.info("zone name:%s The follwoing tests will be re run %s"%(key,tests))
                     if(len(testsToReRun)==0):
                       break
                     else: 
                        self.execOnJenkins(env, testSpecifierString, mailto, reRunFailedTests, retryCount, False, execOnOneZone, postOnPr, testMgr, avoidZones)
               
            if report and postOnPr:
                for key in reportAnalyserMap.keys():
                    self.reportOnPr(reportAnalyserMap[key].generateTextReport2(), env)
            elif report:
                self.reportUsingJenkinsEmailPlugin(cscfg, env)
            return env
        except Exception as e:
            self.logger.exception(e)
开发者ID:bvbharatk,项目名称:cloudstack-automation,代码行数:83,代码来源:testEnv.py

示例11: Jenkins

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
import os
import settings
from jenkins import Jenkins, JenkinsError

# get a handle for the jenkins server
j = Jenkins(os.environ['ENDPOINT'], os.environ['USERNAME'], os.environ['PASSWORD'])

# open the config.xml
with open("./xml/folders/base/config.xml") as config_file:
    config = config_file.read()

for team in settings.teams:
    if j.job_exists(team):
        print("\tFolder exists; skipping: %s" % team)
    else:
        try:
            print("\tCreating folder: %s" % team)
            j.job_create(team, config)
        except JenkinsError as e:
            print("\tERROR: %s" % e)
开发者ID:managedkaos,项目名称:create-jenkins-jobs,代码行数:22,代码来源:folders.py

示例12: execOnJenkins

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
    def execOnJenkins(self,env,testSpecifierString,mailto,execOnOneZone=True):
        try:
              testMgr=testManager(testSpecifierString,env['virtenvPath'])
              jobModifier=modifyJOb()
              modifiedjob=""
              j=Jenkins('http://jenkins-ccp.citrix.com','bharatk','BharatK')
              tests=testMgr.getTests()
              if(tests==None):
                raise Exception("found no tests to run")
              while(not tests is None):
                  #trigger a jenkins job.
                  os.chdir(env['virtenvPath'])
                  self.logger.info("launching jenkins TestExecutor Job")
                  #createing testexecutorjobs for each zone.
                  cscfg=configGenerator.getSetupConfig(env['config_file'])
                  jobIdentifierList=[]
                  for zone in cscfg.zones:
                      for pod in zone.pods:
                         for cluster in pod.clusters:
                             modifiedjob=jobModifier.addTests(env['build_number'],tests)
                             file=open("/root/cloud-autodeploy2/newcode/"+modifiedjob,'r')
                             config=file.read()
                             file.close()
                             bash("rm -f /root/cloud-autodeploy2/newcode/%s"%modifiedjob)
                             if(not j.job_exists(modifiedjob)):
                                  j.create_job(modifiedjob,config)
                             else:
                                  j.reconfig_job(modifiedjob,config)
                             j.build_job(modifiedjob, {'BASEDIR':env['virtenvPath'], 'MGMT_SVR' : env['hostip'],'buildNumber':env['build_number'],'zoneName':zone.name,'hypervisor':cluster.hypervisor.lower(),'zoneType':zone.networktype,'configFileName':env['config_file'],'token':'bharat'})
                             jobIdentifierList.append(zone.name)
                             break
                         break
                      if (execOnOneZone):
                        break
                  self.waitForJobComplete(env['virtenvPath'],jobIdentifierList)
                  tests=testMgr.getTests()  

              j.delete_job(modifiedjob) 
              jobIdentifierList=[]
              bugLoggerData=[]
              time.sleep(30)
              for zone in cscfg.zones:
                 self.logger.info(zone.name)
                 for pod in zone.pods:
                     for cluster in pod.clusters:
                         self.logger.info("creating a jeknins job to generate results and email notfication for hypervisor %s and zone %s"%(cluster.hypervisor, zone.name))
                         modifiedjob=jobModifier.modifyReportGenerator(env['build_number']+"_"+zone.name+"_"+cluster.hypervisor, mailto)
                         jobname=modifiedjob
                         file=open("/root/cloud-autodeploy2/newcode/"+modifiedjob,'r')
                         config=file.read()
                         file.close()
                         j.create_job(modifiedjob,config)
                         j.build_job(modifiedjob, {'buildNumber':env['build_number'],'BuildNo':env['build_number'], 'MGMT_SVR' : env['hostip'], 'BASEDIR':env['virtenvPath'], 'version':env['version'], 'BranchInfo':env['version'],\
                         'GitRepoUrl':env['repo_url'],'GitCommitId':env['commit_id'], 'CIRunStartDateTime':env['startTime'],'CIRunEndDateTime':time.strftime("%c"), 'WikiLinks':'https://cwiki.apache.org/confluence/display/CLOUDSTACK/Infrastructure%2CCI%2CSimulator%2CAutomation+Changes','hypervisor':cluster.hypervisor.lower(), 'HyperVisorInfo':cluster.hypervisor.lower(), 'zoneName':zone.name, 'BuildReport':"http://jenkins-ccp.citrix.com/job/"+jobname+"/1/testReport/",'token':'bharat'})
                         jobIdentifierList.append("report_"+zone.name)
                         jobDetails={"job_name":modifiedjob,"related_data_path":env['virtenvPath']}
                         self.resourceMgr.addJobDetails(jobDetails)
                         bugLoggerData.append({'hypervisor':cluster.hypervisor.lower(), 'branch':env['version'],'logname':cluster.hypervisor.lower()+'__Log_'+env['build_number'], 'type':'BVT'})
                         self.logger.info("bug logger data in zone looop %s"%bugLoggerData)
                         break
                     break
                 if (execOnOneZone):
                    #env['hypervisor':cluster.hypervisor.lower()]
                    break  
              self.logger.info("job identifier list", jobIdentifierList)       
              self.waitForJobComplete(env['virtenvPath'],jobIdentifierList)
              #self.logger.info("deleting the reporter job on jenkins job_name=%s",jobname)
              #j.delete_job(jobname)
              self.logger.info("cleaning up the workspace")
              bash("rm -f /root/cloud-autodeploy2/newcode/%s"%modifiedjob)
              self.logger.info("running bug logger")
              #self.runBugLogger(bugLoggerData)
              #os.system("rm -rf %s"%(self.jenkinsWorkspace+"/"+jobname))
        except Exception, e:
               self.logger.error(e) 
开发者ID:swill,项目名称:cloudstack-automation,代码行数:77,代码来源:testEnv.py

示例13: Jenkins

# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import job_exists [as 别名]
"""
Build: Builds every job for every team defined in settings
"""
import os
from jenkins import Jenkins, JenkinsError
import settings

# get a handle for the jenkins server
j = Jenkins(os.environ['ENDPOINT'], os.environ['USERNAME'], os.environ['PASSWORD'])

for team in settings.teams:
    for job in settings.jobs:
        target = team+"-"+job

        if j.job_exists(target):
            try:
                print("\tBuiding job: %s" % target)
                j.job_build(target)
            except JenkinsError:
                print("\tCouldn't build job: %s" % target)
开发者ID:managedkaos,项目名称:create-jenkins-jobs,代码行数:22,代码来源:build.py


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