示例#1
0
    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'
示例#2
0
    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)
示例#3
0
    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'
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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)
示例#7
0
 def add_branch_test(self):
     p = Projects('test')
     p.add_branch('test_branch')
     assert 'test_branch' in p.branches()
示例#8
0
 def delete_test(self):
     p = Projects('test')
     p.delete()
     assert Projects('test').git_url == ''
示例#9
0
 def add_branch_test(self):
     p = Projects('test')
     p.add_branch('test_branch')
     assert 'test_branch' in p.branches()
示例#10
0
 def delete_test(self):
     p = Projects('test')
     p.delete()
     assert Projects('test').git_url == ''
示例#11
0
 def exist_test(self):
     p = Projects('test')
     assert p.name == 'test'