def create_test(self): p = Projects('test') p.git_url = 'test/test_repo' p.group = 'test_group' p.save() p = Projects('test') assert p.name == 'test' assert p.git_url == 'test/test_repo'
def sched_builder(self): for project in sorted(Projects.get_all(), key=lambda p: p.name): if (project.name == ""): continue try: log.msg("checking project: %s" % project.name) if project.is_building(): log.msg("project %s still building, skip" % project.name) continue branch = "master" git = Git(project) if os.path.isdir(git.workdir): git.checkout_branch(branch) git.pull() else: git.clone(branch) if (not os.path.isdir(git.workdir)): continue for remote_branch in git.branches(remote=True): git.checkout_remote_branch( remote_branch.replace('origin/', '')) for release in ('stable', 'testing', 'unstable'): if project.last_tag(release) != git.last_tag(release): try: _, version = git.last_tag(release).split('_') log.msg("new %s tag, building version: %s" % (release, version)) d = threads.deferToThread(self.send_job, project.name, branch, release, version) except Exception, e: log.msg("tag not parsed: %s:%s" % (project.name, git.last_tag(release))) #if int(project.experimental) == 1: # for branch in project.branches(): # git.checkout_remote_branch(branch) # git.checkout_branch(branch) # git.pull() # if project.last_commit(branch) != git.last_commit(branch): # project.last_commit(branch, git.last_commit(branch)) # d = threads.deferToThread(self.send_job, project.name, branch, 'experimental', None) # # git.checkout_branch("master") except Exception, e: log.err(e)
def build_init_test(self): print os.path.abspath(os.path.curdir) p = Projects('test_build') p.git_url = 'test/test_repo' p.group = 'test_group' p.version = '0.100.0' p.save() b = Builder(p.name) pre_build_id = BuildInfo(p) b.build_project(branch='master', release='testing', version='0.0.1', commit=None) assert( BuildInfo(p).build_id != pre_build_id)
def build_init_test(self): print os.path.abspath(os.path.curdir) p = Projects('test_build') p.git_url = 'test/test_repo' p.group = 'test_group' p.version = '0.100.0' p.save() b = Builder('test_build') b.build_project(branch='master', release='experimental', version='0.100.1', commit=None) assert(False)
def sched_builder(self): for project in sorted(Projects.get_all(), key=lambda p: p.name): if (project.name == ""): continue try: log.msg("checking project: %s" % project.name) if project.is_building(): log.msg("project %s still building, skip" % project.name) continue branch = "master" git = Git(project) if os.path.isdir(git.workdir): git.checkout_branch(branch) git.pull() else: git.clone(branch) if not os.path.isdir(git.workdir): continue for remote_branch in git.branches(remote=True): git.checkout_remote_branch(remote_branch.replace('origin/', '')) for release in ('stable', 'testing', 'unstable'): if project.last_tag(release) != git.last_tag(release): try: _, version = git.last_tag(release).split('_') log.msg("new %s tag, building version: %s" % (release, version)) d = threads.deferToThread(self.send_job, project.name, branch, release, version) except Exception, e: log.msg("tag not parsed: %s:%s" % (project.name, git.last_tag(release))) #if int(project.experimental) == 1: # for branch in project.branches(): # git.checkout_remote_branch(branch) # git.checkout_branch(branch) # git.pull() # if project.last_commit(branch) != git.last_commit(branch): # project.last_commit(branch, git.last_commit(branch)) # d = threads.deferToThread(self.send_job, project.name, branch, 'experimental', None) # # git.checkout_branch("master") except Exception, e: log.err(e)
def add_branch_test(self): p = Projects('test') p.add_branch('test_branch') assert 'test_branch' in p.branches()
def delete_test(self): p = Projects('test') p.delete() assert Projects('test').git_url == ''
def exist_test(self): p = Projects('test') assert p.name == 'test'