def configure(self, config_dict):
        c = self.config = config_dict
        PORT = int(os.environ.get('PORT', 8010))
        c.setdefault(
            'buildbotURL',
            os.environ.get('buildbotURL', "http://localhost:%d/" % (PORT, )))

        db_url = os.environ.get('BUILDBOT_DB_URL')
        if db_url is not None:
            self.config.setdefault('db', {'db_url': db_url})

        # minimalistic config to activate new web UI
        c.setdefault(
            'www',
            dict(
                port=PORT,
                plugins=dict(console_view=True, waterfall_view=True),
            ))
        c.setdefault('protocols', {'pb': {'port': 9989}})
        c.setdefault('builders', [])
        c.setdefault('schedulers', [])

        # Define the builder for the main job
        f = factory.BuildFactory()
        f.addStep(
            Git(repourl=Property("repository"),
                codebase=Property("codebase"),
                name='git',
                shallow=1))
        f.addStep(SpawnerStep())

        self.config['builders'].append(
            BuilderConfig(name='__spawner',
                          workernames=self.get_spawner_workers(),
                          collapseRequests=False,
                          factory=f))
        self.config['schedulers'].append(
            AnyCodeBaseScheduler(name='__spawner', builderNames=['__spawner']))

        # Define the builder for the main job
        f = factory.BuildFactory()
        f.addStep(RunnerStep())

        self.config['builders'].append(
            BuilderConfig(name='__runner',
                          workernames=self.get_runner_workers(),
                          collapseRequests=False,
                          factory=f))
        self.config['schedulers'].append(
            Triggerable(
                name='__runner',
                builderNames=['__runner'],
                codebases={},
            ))
Beispiel #2
0
def gen_svn_updated_valgrind_factory(baseURL, configure_opts=[]):
    """
    Factory for doing HEAD build from SVN, without cleaning first, and using
    valgrind to check.  This one is much more expensive, so should be run with
    a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk',
                         mode="update"))
    f.addStep(Bootstrap())
    configure_opts.append("--disable-documentation")
    f.addStep(
        shell.Configure(command=["sh", "configure", "CXXFLAGS=-O0 -g"] +
                        configure_opts))
    f.addStep(
        QuietenLibtool([
            'xapian-core/libtool', 'xapian-applications/omega/libtool',
            'xapian-bindings/libtool'
        ]))
    f.addStep(shell.Compile())

    f.addStep(
        shell.Test(name="check",
                   command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"],
                   workdir='build/xapian-core'))

    return f
Beispiel #3
0
def gen_svn_debug_updated_factory(baseURL, opts, nocheck=False):
    """
    Make a factory for doing a debug HEAD build from SVN, but without cleaning
    first.  This build is intended to catch commonly made mistakes quickly.
    """
    f = factory.BuildFactory()
    f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk',
                         mode="update"))
    f.addStep(Bootstrap())
    opts.append("--disable-documentation")
    f.addStep(shell.Configure(command=[
        "sh",
        "configure",
    ] + opts))
    f.addStep(
        QuietenLibtool([
            'xapian-core/libtool', 'xapian-applications/omega/libtool',
            'xapian-bindings/libtool'
        ]))
    f.addStep(shell.Compile())
    if not nocheck:
        f.addStep(
            shell.Test(name="check",
                       command=[
                           "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain",
                           "VALGRIND="
                       ]))
    return f
    def addSlave(self, **kwargs):
        """
        Create a master-side slave instance and add it to the BotMaster

        @param **kwargs: arguments to pass to the L{BuildSlave} constructor.
        """
        self.buildslave = buildslave.BuildSlave("testslave", "pw", **kwargs)

        # patch in our FakeBuilder for the regular Builder class
        self.patch(botmaster, 'Builder', FakeBuilder)

        # reconfig the master to get it set up
        new_config = self.master.config
        new_config.protocols = {"pb": {"port": "tcp:0:interface=127.0.0.1"}}
        new_config.slaves = [self.buildslave]
        new_config.builders = [
            config.BuilderConfig(name='bldr',
                                 slavename='testslave',
                                 factory=factory.BuildFactory())
        ]

        yield self.botmaster.reconfigService(new_config)

        # as part of the reconfig, the slave registered with the pbmanager, so
        # get the port it was assigned
        self.port = self.buildslave.registration.getPort()
Beispiel #5
0
 def test_load_builders_abs_builddir(self):
     bldr = dict(name='x',
                 factory=factory.BuildFactory(),
                 slavename='x',
                 builddir=os.path.abspath('.'))
     self.cfg.load_builders(self.filename, dict(builders=[bldr]))
     self.assertEqual(len(self.flushWarnings([self.cfg.load_builders])), 1)
Beispiel #6
0
def gen_tarball_updated_factory(rooturl, nocheck=False, omega=True, configure_opts=[]):
    """
    Make a factory for doing builds from tarballs.
    """
    configure_cmd = ["sh", "configure", ] + configure_opts
    f = factory.BuildFactory()
    f.addStep(shell.ShellCommand(command = ["python", "-c", "try: import urllib2 as u\nexcept: import urllib.request as u\nopen('get_tarballs.py', 'wb').write(u.urlopen('%s').read())" %
              'http://trac.xapian.org/export/HEAD/trunk/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py'], workdir='.', haltOnFailure=True))
    f.addStep(shell.ShellCommand(command = ["python", 'get_tarballs.py', rooturl], workdir='.', haltOnFailure=True))
    f.addStep(shell.Configure(workdir='build/xapian-core', command=configure_cmd))
    f.addStep(shell.Compile(workdir='build/xapian-core'))
    if not nocheck:
        f.addStep(shell.Test(workdir='build/xapian-core', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    if omega:
        f.addStep(shell.Configure(workdir='build/xapian-omega', command = ["./configure", xapian_config_arg] + configure_opts))
        f.addStep(shell.Compile(workdir='build/xapian-omega'))
        if not nocheck:
            f.addStep(shell.Test(workdir='build/xapian-omega', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    f.addStep(shell.Configure(workdir='build/xapian-bindings', command = ["./configure", xapian_config_arg] + configure_opts))
    f.addStep(shell.Compile(workdir='build/xapian-bindings', command = ["make"]))
    if not nocheck:
        f.addStep(shell.Test(workdir='build/xapian-bindings', name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    # If everything passed, there's not much point keeping the build - we'd
    # delete the old build tree and download new tarballs next time anyway.
    f.addStep(slave.RemoveDirectory('build'))
    return f
Beispiel #7
0
def gen_svn_updated_lcov_factory(baseURL, configure_opts=[]):
    """
    Factory for doing HEAD build from SVN, without cleaning first, and using
    lcov to generate a coverage report.  This one is much more expensive, so
    should be run with a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk',
                         mode="update"))
    f.addStep(Bootstrap())
    f.addStep(
        shell.Configure(command=[
            "sh", "configure", "--disable-shared", "CXXFLAGS=-O0 --coverage"
        ] + configure_opts,
                        workdir="build/xapian-core"))
    f.addStep(shell.Compile(workdir="build/xapian-core"))
    f.addStep(
        shell.ShellCommand(
            command=["make", "coverage-check", "GENHTML_ARGS=--html-gzip"],
            workdir="build/xapian-core",
            haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(command=["chmod", "-R", "a+rX", "lcov"],
                           workdir="build/xapian-core",
                           haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(
            command=
            'NOW=`date -u +%Y-%m-%d`; cp -a lcov/. /var/www/"$NOW" && ln -sfT "$NOW" /var/www/latest',
            workdir="build/xapian-core",
            haltOnFailure=True))

    return f
Beispiel #8
0
    def do_test_nextWorker(self, nextWorker, exp_choice=None):
        builder_config = config.BuilderConfig(name='bldrconf',
                                              workernames=['wk1', 'wk2'],
                                              builddir='bdir',
                                              factory=factory.BuildFactory(),
                                              nextWorker=nextWorker)
        self.bldr = yield self.createBuilder('B',
                                             builderid=78,
                                             builder_config=builder_config)
        for i in range(4):
            self.addWorkers({'test-worker%d' % i: 1})

        rows = [
            fakedb.SourceStamp(id=21),
            fakedb.Builder(id=78, name='B'),
            fakedb.Buildset(id=12, reason='because'),
            fakedb.BuildsetSourceStamp(sourcestampid=21, buildsetid=12),
            fakedb.BuildRequest(id=12, buildsetid=12, builderid=78),
        ]

        if exp_choice is None:
            exp_claims = []
            exp_builds = []
        else:
            exp_claims = [12]
            exp_builds = [('test-worker%d' % exp_choice, [12])]

        yield self.do_test_maybeStartBuildsOnBuilder(rows=rows,
                                                     exp_claims=exp_claims,
                                                     exp_builds=exp_builds)
Beispiel #9
0
    def makeBuilder(self, name="bldr", patch_random=False, **config_kwargs):
        """Set up C{self.bldr}"""
        self.factory = factory.BuildFactory()
        self.master = fakemaster.make_master()
        # only include the necessary required config, plus user-requested
        config_args = dict(name=name, slavename="slv", builddir="bdir",
                           slavebuilddir="sbdir", factory=self.factory)
        config_args.update(config_kwargs)
        self.builder_config = config.BuilderConfig(**config_args)
        self.bldr = builder.Builder(self.builder_config.name, _addServices=False)
        self.master.db = self.db = fakedb.FakeDBConnector(self)
        self.bldr.master = self.master
        self.bldr.botmaster = self.master.botmaster

        # patch into the _startBuildsFor method
        self.builds_started = []

        def _startBuildFor(slavebuilder, buildrequests):
            self.builds_started.append((slavebuilder, buildrequests))
            return defer.succeed(True)
        self.bldr._startBuildFor = _startBuildFor

        if patch_random:
            # patch 'random.choice' to always take the slave that sorts
            # last, based on its name
            self.patch(random, "choice",
                       lambda lst: sorted(lst, key=lambda m: m.name)[-1])

        self.bldr.startService()

        mastercfg = config.MasterConfig()
        mastercfg.builders = [self.builder_config]
        return self.bldr.reconfigService(mastercfg)
Beispiel #10
0
def gen_svn_clean_factory(baseURL):
    """
    Factory for doing HEAD build from a clean SVN checkout.  This build also
    performs a "make distcheck", so should catch problems with files which have
    been missed from the distribution.  This one is much more expensive, so
    should be run with a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(MakeWritable, workdir='.')
    f.addStep(step.SVN, baseURL=baseURL, defaultBranch='trunk', mode="clobber")
    f.addStep(Bootstrap)
    f.addStep(step.Configure, command = ["xapian-maintainer-tools/buildbot/scripts/configure_with_prefix.sh"])
    extraargs = (
        "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="
    )
    f.addStep(step.Compile, command=("make",) + extraargs)
    # Don't bother running check as a separate step - all the checks will be
    # done by distcheck, anyway.  (Running it as a separate step _does_ check
    # that the tests work in a non-VPATH build, but this is tested by other
    # factories, anyway.)
    #f.addStep(step.Test, name="check", command=("make", "check") + extraargs)
    f.addStep(step.Test, name="distcheck", command=("make", "distcheck") + extraargs, workdir='build/xapian-core')
    f.addStep(step.Test, name="distcheck", command=("make", "distcheck") + extraargs, workdir='build/xapian-applications/omega')

    # Have to install the core for distcheck to pass on the bindings.
    f.addStep(step.Test, name="install", command=("make", "install") + extraargs, workdir='build/xapian-core')
    f.addStep(step.Test, name="distcheck", command=("make", "distcheck") + extraargs, workdir='build/xapian-bindings')
    return f
Beispiel #11
0
def mkdocsfactory():
    f = factory.BuildFactory()
    f.addSteps([
        gitStep,
        downloadStep,

        # run docs tools in their own virtualenv, otherwise we end up documenting
        # the version of Buildbot running the metabuildbot!
        VirtualenvSetup(name='virtualenv setup',
                        virtualenv_packages=[
                            '--editable=master[docs]', '--editable=worker'
                        ],
                        virtualenv_dir='sandbox',
                        haltOnFailure=True),

        # manual
        ShellCommand(command=Interpolate(
            textwrap.dedent("""\
        export VERSION=latest &&
        . sandbox/bin/activate &&
        gmake docs
        """)),
                     name="create docs"),
    ])
    return f
Beispiel #12
0
def gen_svn_updated_valgrind_factory(baseURL, configure_opts=[]):
    """
    Factory for doing HEAD build from SVN, without cleaning first, and using
    valgrind to check.  This one is much more expensive, so should be run with
    a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.SVN(baseURL=baseURL, defaultBranch='trunk',
                         mode="update"))
    f.addStep(Bootstrap())
    f.addStep(
        shell.Configure(command=["sh", "configure", "CXXFLAGS=-O0 -g"] +
                        configure_opts))
    f.addStep(shell.Compile())

    f.addStep(
        shell.Test(name="check",
                   command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"],
                   workdir='build/xapian-core'))
    #for target in ("check-none", "check-inmemory", "check-remoteprog",
    #               "check-chert"):
    #    f.addStep(shell.Test(name=target, command = ["make", target, "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=/home/olly/install/bin/valgrind"], workdir='build/xapian-core'))
    #
    ## Currently, valgrind incorrectly reports leaked memory for the remotetcp
    ## backend, so check that one without using valgrind.
    #f.addStep(shell.Test(name="check-remotetcp", command = ["make", "check-remotetcp", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND=/home/olly/install/bin/valgrind"], workdir='build/xapian-core'))

    return f
Beispiel #13
0
def MakeFedoraBuilder(distro, unused_is_64_bit):
    f = factory.BuildFactory()
    f.addStep(git.Git(**GitArgs("Clementine")))
    f.addStep(
        shell.ShellCommand(name="clean",
                           workdir="source/bin",
                           command="find ~/rpmbuild/ -type f -delete"))
    f.addStep(
        shell.ShellCommand(name="cmake",
                           workdir="source/bin",
                           haltOnFailure=True,
                           command=["cmake", ".."]))
    f.addStep(
        shell.ShellCommand(name="maketarball",
                           workdir="source/bin",
                           haltOnFailure=True,
                           command=["../dist/maketarball.sh"]))
    f.addStep(
        shell.ShellCommand(
            name="movetarball",
            workdir="source/bin",
            haltOnFailure=True,
            command="mv clementine-*.tar.xz ~/rpmbuild/SOURCES"))
    f.addStep(
        shell.Compile(name="rpmbuild",
                      workdir="source/bin",
                      haltOnFailure=True,
                      command=["rpmbuild", "-ba", "../dist/clementine.spec"]))
    f.addStep(OutputFinder(pattern="~/rpmbuild/RPMS/*/clementine-*.rpm"))
    f.addStep(UploadPackage("fedora-" + distro))
    return f
Beispiel #14
0
def gen_git_updated_lcov_factory(repourl, configure_opts=[]):
    """
    Factory for doing build from git master, without cleaning first, and using
    lcov to generate a coverage report.  This one is much more expensive, so
    should be run with a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.Git(repourl=repourl, mode="update"))
    f.addStep(Bootstrap())
    f.addStep(
        shell.Configure(command=[
            "sh", "configure", "--enable-maintainer-mode", "--disable-shared",
            "--disable-documentation", "CXXFLAGS=-O0 --coverage", "VALGRIND=",
            "CCACHE_DISABLE=1"
        ] + configure_opts,
                        workdir="build/xapian-core"))
    f.addStep(shell.Compile(workdir="build/xapian-core"))
    f.addStep(
        shell.ShellCommand(
            command=["make", "coverage-check", "GENHTML_ARGS=--html-gzip"],
            workdir="build/xapian-core",
            haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(command=["chmod", "-R", "a+rX", "lcov"],
                           workdir="build/xapian-core",
                           haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(
            command=
            'NOW=`date -u +%Y-%m-%d`; cp -a lcov/. /var/www/"$NOW" && ln -sfT "$NOW" /var/www/latest',
            workdir="build/xapian-core",
            haltOnFailure=True))

    return f
Beispiel #15
0
 def test_load_builders_dict(self):
     bldr = dict(name='x', factory=factory.BuildFactory(), slavename='x', project="default")
     self.cfg.load_builders(self.filename,
             dict(builders=[bldr]))
     self.assertIsInstance(self.cfg.builders[0], config.BuilderConfig)
     self.assertEqual(self.cfg.builders[0].name, 'x')
     self.assertEqual(self.cfg.builders[0].project, "default")
Beispiel #16
0
 def test_load_builders(self):
     bldr = config.BuilderConfig(name='x',
                                 factory=factory.BuildFactory(),
                                 slavename='x')
     self.cfg.load_builders(self.filename, dict(builders=[bldr]),
                            self.errors)
     self.assertResults(builders=[bldr])
    def addMasterSideWorker(
            self,
            connection_string=r"tcp:{port}:interface=127.0.0.1".format(
                port=DEFAULT_PORT),
            name="testworker",
            password="******",
            update_port=True,
            **kwargs):
        """
        Create a master-side worker instance and add it to the BotMaster

        @param **kwargs: arguments to pass to the L{Worker} constructor.
        """
        self.buildworker = worker.Worker(name, password, **kwargs)

        # reconfig the master to get it set up
        new_config = self.master.config
        new_config.protocols = {"pb": {"port": connection_string}}
        new_config.workers = [self.buildworker]
        new_config.builders = [
            config.BuilderConfig(name='bldr',
                                 workername='testworker',
                                 factory=factory.BuildFactory())
        ]

        yield self.botmaster.reconfigServiceWithBuildbotConfig(new_config)
        yield self.workers.reconfigServiceWithBuildbotConfig(new_config)

        if update_port:
            # as part of the reconfig, the worker registered with the
            # pbmanager, so get the port it was assigned
            self.port = self.buildworker.registration.getPBPort()
Beispiel #18
0
def mkcoveragefactory():
    f = factory.BuildFactory()
    f.addSteps([
        gitStep,
        downloadStep,
        VirtualenvSetup(name='virtualenv setup',
                        virtualenv_packages=[
                            'coverage', 'mock', '--editable=master[tls,test]',
                            '--editable=worker'
                        ],
                        virtualenv_dir='sandbox',
                        haltOnFailure=True),
        ShellCommand(usePTY=False,
                     command=textwrap.dedent("""
        PYTHON=sandbox/bin/python;
        sandbox/bin/coverage run --rcfile=common/coveragerc \
            sandbox/bin/trial buildbot.test buildbot_worker.test \
            || exit 1;
        sandbox/bin/coverage html -i --rcfile=.coveragerc \
            -d /home/buildbot/www/buildbot.buildbot.net/static/coverage \
            || exit 1;
        chmod -R a+rx /home/buildbot/www/buildbot.buildbot.net/static/coverage || exit 1
    """),
                     description='coverage',
                     descriptionDone='coverage',
                     name='coverage report'),
    ])
    return f
Beispiel #19
0
def MakeDebBuilder(distro, version, is_64_bit):
    arch = "amd64" if is_64_bit else "i386"

    env = {
        "DEB_BUILD_OPTIONS": "parallel=4",
    }

    cmake_cmd = [
        "cmake",
        "..",
        "-DWITH_DEBIAN=ON",
        "-DDEB_ARCH=" + arch,
        "-DDEB_DIST=" + version,
        "-DFORCE_GIT_REVISION=",
        "-DENABLE_SPOTIFY_BLOB=OFF",
    ]
    make_cmd = ["make", "deb"]

    f = factory.BuildFactory()
    f.addStep(git.Git(**GitArgs("Clementine")))
    f.addStep(
        shell.ShellCommand(name="cmake",
                           command=cmake_cmd,
                           haltOnFailure=True,
                           workdir="source/bin"))
    f.addStep(
        shell.Compile(command=make_cmd,
                      haltOnFailure=True,
                      workdir="source/bin",
                      env=env))
    f.addStep(OutputFinder(pattern="bin/clementine_*.deb"))
    f.addStep(UploadPackage("%s-%s" % (distro, version)))
    return f
Beispiel #20
0
def MakeAndroidRemoteBuilder():
    f = factory.BuildFactory()
    f.addStep(git.Git(**GitArgs("Android-Remote")))

    env = {
        "ANDROID_HOME": "/android-sdk-linux",
    }

    # Change path to properties file here
    sed_cmd = [
        "sed", "-i", "-e",
        "s:key.properties:/config/android-remote-properties.txt:g",
        "app/build.gradle"
    ]

    f.addStep(
        shell.ShellCommand(name="sed",
                           command=sed_cmd,
                           haltOnFailure=True,
                           workdir="source"))
    f.addStep(
        shell.ShellCommand(name="compile",
                           haltOnFailure=True,
                           workdir="source",
                           env=env,
                           command=["./gradlew", "assembleRelease"]))
    f.addStep(
        OutputFinder(
            pattern="app/build/outputs/apk/ClementineRemote-release-*.apk"))
    f.addStep(UploadPackage("android"))
    return f
Beispiel #21
0
def core_factory(repourl, usedocs=False, configure=None, audit=False,
                 clean=False, nocheck = False, configure_opts=None):
    f = factory.BuildFactory()
    mode = "update"
    if clean:
        #f.addStep(MakeWritable, workdir='.')
        f.addStep(shell.ShellCommand(command = ["chmod", "-R", "+w", "."], workdir='.'))
        mode = "clobber"
    f.addStep(source.Git(repourl=repourl, mode=mode))
    if audit:
        f.addStep(shell.ShellCommand(command = ["python", 'audit.py'], workdir='build/xapian-maintainer-tools'))
        f.addStep(shell.ShellCommand(command = ["chmod", '644', 'copyright.csv', 'fixmes.csv'], workdir='build/xapian-maintainer-tools'))
        f.addStep(shell.ShellCommand(command = ["mv", 'copyright.csv', 'fixmes.csv', '/var/www/'], workdir='build/xapian-maintainer-tools'))

    f.addStep(Bootstrap())
    if configure:
        f.addStep(shell.Configure(command=configure))
    else:
        if configure_opts is None:
            configure_opts = []
        if not usedocs:
            configure_opts.append("--disable-documentation")
        if configure_opts:
            f.addStep(shell.Configure(command=["sh", "configure"] + configure_opts))
        else:
            f.addStep(shell.Configure())

    f.addStep(shell.Compile())
    if not nocheck:
        f.addStep(shell.Test(name="check", command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    return f
Beispiel #22
0
def createLLVMFactory(srcdir, builddir, installdir, test_install_dir):

    f = factory.BuildFactory()
    f.addStep(
        SVN(name='svn-llvm',
            mode='update',
            baseURL='http://llvm.org/svn/llvm-project/llvm/',
            defaultBranch='trunk',
            workdir=srcdir))
    f.addStep(
        SVN(name='svn-clang',
            mode='update',
            baseURL='http://llvm.org/svn/llvm-project/cfe/',
            defaultBranch='trunk',
            workdir='%s/tools/clang' % srcdir))
    f.addStep(
        ShellCommand(command=[
            '%s/configure' % srcdir, '--prefix=' + installdir,
            '--enable-optimized', '--enable-targets=host', '--enable-shared'
        ],
                     workdir=builddir,
                     haltOnFailure=True,
                     name="configure",
                     descriptionDone='configure',
                     description='configuring'))
    f.addStep(
        ShellCommand(command=['make', '-j', '4'],
                     workdir=builddir,
                     haltOnFailure=True,
                     name="compile",
                     descriptionDone='compile',
                     description='compiling'))
    f.addStep(
        ShellCommand(command=['make', 'check'],
                     workdir=builddir,
                     name='check',
                     descriptionDone='check',
                     haltOnFailure=True,
                     description='checking'))
    f.addStep(
        ShellCommand(command=['make', 'install'],
                     env={'DESTDIR': test_install_dir},
                     workdir=builddir,
                     haltOnFailure=True,
                     name='install',
                     descriptionDone='install',
                     description='installing'))

    f = createPoclFactory(llvm_dir=test_install_dir + installdir, f=f)

    f.addStep(
        ShellCommand(command=['make', 'install'],
                     workdir=builddir,
                     haltOnFailure=True,
                     name='install',
                     descriptionDone='install',
                     description='installing'))

    return f
Beispiel #23
0
def MakeDebBuilder(distro, version):

  f = factory.BuildFactory()
  f.addStep(git.Git(**GitArgs("strawberry", "master")))

  f.addStep(
    shell.ShellCommand(
      name="run cmake",
      workdir="source/build",
      command=["cmake", ".."],
      haltOnFailure=True
    )
  )

  f.addStep(
    shell.Compile(
      name="run dpkg-buildpackage",
      workdir="source",
      command=["dpkg-buildpackage", "-b", "-d", "-uc", "-us", "-nc", "-tc"],
      haltOnFailure=True
    )
  )

  f.addStep(
    steps.SetPropertyFromCommand(
      name="get output filename for deb",
      workdir="source",
      command=["sh", "-c", "ls -dt ../strawberry_*.deb | head -n 1"],
      property="output-filepath",
      haltOnFailure=True
    )
  )
  f.addStep(steps.SetProperties(properties=get_base_filename))
  f.addStep(UploadPackage("%s/%s" % (distro, version)))

  f.addStep(
    steps.SetPropertyFromCommand(
      name="get output filename for deb dbgsym",
      workdir="source",
      command=["sh", "-c", "ls -dt ../strawberry-dbgsym_*.*deb | head -n 1"],
      property="output-filepath",
      haltOnFailure=True
    )
  )
  f.addStep(steps.SetProperties(properties=get_base_filename))
  f.addStep(UploadPackage("%s/%s" % (distro, version)))

  f.addStep(
    shell.ShellCommand(
      name="delete file",
      workdir=".",
      command="rm -f *.deb *.ddeb *.buildinfo *.changes",
      haltOnFailure=True
    )
  )

  return f
Beispiel #24
0
 def __init__(self,
              target_platform=None,
              os_version=None,
              build_factory=None):
     if not build_factory:
         build_factory = factory.BuildFactory()
     self.factory = build_factory
     self.target_platform = OsShortName(target_platform)
     self.os_version = os_version
Beispiel #25
0
def gen_tarball_updated_factory(rooturl, configure_opts=[]):
    """
    Make a factory for doing builds from tarballs.
    """
    configure_cmd = [
        "sh",
        "configure",
    ] + configure_opts
    f = factory.BuildFactory()
    f.addStep(
        shell.ShellCommand(command=[
            "python", "-c",
            "import urllib2;open('get_tarballs.py', 'wb').write(urllib2.urlopen('%s').read())"
            %
            'http://trac.xapian.org/export/HEAD/trunk/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py'
        ],
                           workdir='.',
                           haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(command=["python", 'get_tarballs.py'],
                           workdir='.',
                           haltOnFailure=True))
    f.addStep(
        shell.Configure(workdir='build/xapian-core', command=configure_cmd))
    f.addStep(shell.Compile(workdir='build/xapian-core'))
    f.addStep(
        shell.Test(workdir='build/xapian-core',
                   name="check",
                   command=[
                       "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain",
                       "VALGRIND="
                   ]))
    f.addStep(
        shell.Configure(workdir='build/xapian-omega',
                        command=["./configure", xapian_config_arg] +
                        configure_opts))
    f.addStep(shell.Compile(workdir='build/xapian-omega'))
    f.addStep(
        shell.Test(workdir='build/xapian-omega',
                   name="check",
                   command=[
                       "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain",
                       "VALGRIND="
                   ]))
    f.addStep(
        shell.Configure(workdir='build/xapian-bindings',
                        command=["./configure", xapian_config_arg] +
                        configure_opts))
    f.addStep(shell.Compile(workdir='build/xapian-bindings', command=["make"]))
    f.addStep(
        shell.Test(workdir='build/xapian-bindings',
                   name="check",
                   command=[
                       "make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain",
                       "VALGRIND="
                   ]))
    return f
Beispiel #26
0
def MakePPABuilder(distro, ppa):
    git_args = GitArgs("Clementine")
    git_args["mode"] = "full"

    cmake_cmd = [
        "cmake",
        "..",
        "-DWITH_DEBIAN=ON",
        "-DDEB_DIST=" + distro,
    ]
    clean_cmd = "rm -rvf *.diff.*z *.tar.*z *.dsc *_source.changes source/bin/*"
    buildpackage_cmd = ["dpkg-buildpackage", "-S", "-kF6ABD82E"]
    movetarball_cmd = "mv -v source/dist/*.orig.tar.xz ."
    cleanuptarball_cmd = "rm -rfv source/dist/*.tar.*z source/.git"
    keys_cmd = "gpg --import /config/ppa-keys || true"
    dput_cmd = "dput %s *_source.changes" % ppa

    f = factory.BuildFactory()
    f.addStep(git.Git(**git_args))
    f.addStep(
        shell.ShellCommand(name="cmake",
                           command=cmake_cmd,
                           haltOnFailure=True,
                           workdir="source/bin"))
    f.addStep(
        shell.ShellCommand(name="clean",
                           command=clean_cmd,
                           haltOnFailure=True,
                           workdir="."))
    f.addStep(
        shell.ShellCommand(name="maketarball",
                           command=["./maketarball.sh"],
                           haltOnFailure=True,
                           workdir="source/dist"))
    f.addStep(
        shell.ShellCommand(name="movetarball",
                           command=movetarball_cmd,
                           haltOnFailure=True,
                           workdir="."))
    f.addStep(
        shell.ShellCommand(name="cleanuptarball",
                           command=cleanuptarball_cmd,
                           haltOnFailure=True,
                           workdir="."))
    f.addStep(shell.ShellCommand(name="keys", command=keys_cmd, workdir="."))
    f.addStep(
        shell.ShellCommand(name="buildpackage",
                           command=buildpackage_cmd,
                           haltOnFailure=True,
                           workdir="source"))
    f.addStep(
        shell.ShellCommand(name="dput",
                           command=dput_cmd,
                           haltOnFailure=True,
                           workdir="."))
    return f
Beispiel #27
0
def MakeWebsiteTransifexPotPushBuilder():
    f = factory.BuildFactory()
    f.addStep(git.Git(**GitArgs("Website")))
    _AddTxSetupForRepo(f, "Website")
    f.addStep(
        shell.ShellCommand(name="tx_push",
                           workdir="source",
                           haltOnFailure=True,
                           command=["tx", "push", "-s"]))
    return f
Beispiel #28
0
def gen_tarball_updated_win_factory(rooturl):
    """Make a factory for doing builds from tarballs on windows.

    """
    f = factory.BuildFactory()
    f.addStep(step.ShellCommand, command = ["python", "-c", "import urllib2;open('get_tarballs.py', 'wb').write(urllib2.urlopen('%s').read())" %
              'http://svn.xapian.org/*checkout*/trunk/xapian-maintainer-tools/buildbot/scripts/get_tarballs.py'], workdir='.', haltOnFailure=True)
    f.addStep(step.ShellCommand, command = ["python", 'get_tarballs.py'], workdir='.', haltOnFailure=True)
    f.addStep(step.Compile, workdir='build/xapian-core/win32', command=("compile_with_vc7.bat"))
    return f
Beispiel #29
0
def gen_rh_full_factory (svnURL):
	linux_rh_full_factory = factory.BuildFactory()
	linux_rh_full_factory.addStep(SVN, workdir=r'build',svnurl=svnURL,username='******',password="******")
	linux_rh_full_factory.addStep(ShellCommand, workdir=r'build', name='autoreconf',
			   description=['autoreconf'], descriptionDone=['autoreconf'],
			   command=['autoreconf', '-is'])
	linux_rh_full_factory.addStep(Configure, workdir=r'build')
	linux_rh_full_factory.addStep(Compile, workdir=r'build', command=['make', 'over'])

	return linux_rh_full_factory
Beispiel #30
0
def sphinx_factory(repo, target='publish', branch='master'):
    f = factory.BuildFactory()

    # check out the source
    f.addStep(Git(repourl=repo,
                  branch=branch,
                  retry=GIT_RETRY))

    # run the build process.
    f.addStep(ShellCommand(command=["make", target]))