Skip to content

Instantly share code, notes, and snippets.

@Clcanny
Last active May 11, 2017 23:38
Show Gist options
  • Save Clcanny/e49e1c2f443bc795516bed7061b9a03d to your computer and use it in GitHub Desktop.
Save Clcanny/e49e1c2f443bc795516bed7061b9a03d to your computer and use it in GitHub Desktop.
Compile_Lab的持续集成环境
docker build -t clbuildbot .
docker run -t -i --name clbb -p 8010:8010 clbuildbot /bin/bash
buildbot start master
buildbot-worker start worker
Ctrl + p + Ctrl + q(detach以回到主机命令行,即使退出ssh,容器也会继续运行)
FROM python:3.6.1
ADD sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
python-dev \
python-pip \
flex bison gcc make valgrind
RUN pip install 'buildbot[bundle]' -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install buildbot-worker -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN buildbot create-master master
ADD master.cfg master/master.cfg
# RUN buildbot start master
RUN buildbot-worker create-worker worker localhost example-worker pass
# RUN buildbot-worker start worker
# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### WORKERS
# The 'workers' list defines the set of recognized workers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# worker name and password must be configured on the worker.
c['workers'] = [worker.Worker("example-worker", "pass")]
# 'protocols' contains information about protocols which master will use for
# communicating with workers. You must define at least 'port' option that workers
# could connect to your master with this protocol.
# 'port' must match the value configured into the workers (with their
# --master option)
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot clone of pyflakes.
c['change_source'] = []
# c['change_source'].append(changes.GitPoller(
# 'git://github.com/buildbot/pyflakes.git',
# workdir='gitpoller-workdir', branch='master',
# pollinterval=300))
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes. In this
# case, just kick off a 'runtests' build
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=util.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.
factory = util.BuildFactory()
# check out the source
factory.addStep(steps.Git(repourl='https://github.com/Clcanny/Sword.git', mode='full', haltOnFailure=True))
factory.addStep(steps.ShellCommand(command=["make", "compileAbstract"], workdir="build/TestSyntax", name='syntax-compileAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "compileDetail"], workdir="build/TestSyntax", name='syntax-compileDetail'))
factory.addStep(steps.ShellCommand(command=["make", "runAbstract"], workdir="build/TestSyntax", name='syntax-runAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "runDetail"], workdir="build/TestSyntax", name='syntax-runDetail'))
factory.addStep(steps.ShellCommand(command=["make", "testAbstract"], workdir="build/TestSyntax", name='syntax-testAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "testDetail"], workdir="build/TestSyntax", name='syntax-testDetail'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryAbstract"], workdir="build/TestSyntax", name='syntax-checkMemoryAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryDetail"], workdir="build/TestSyntax", name='syntax-checkMemoryDetail'))
factory.addStep(steps.ShellCommand(command=["make", "compileAbstract"], workdir="build/TestSymbolTable", name='symbolTable-compileAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "compileDetail"], workdir="build/TestSymbolTable", name='symbolTable-compileDetail'))
factory.addStep(steps.ShellCommand(command=["make", "runAbstract"], workdir="build/TestSymbolTable", name='symbolTable-runAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "runDetail"], workdir="build/TestSymbolTable", name='symbolTable-runDetail'))
factory.addStep(steps.ShellCommand(command=["make", "testAbstract"], workdir="build/TestSymbolTable", name='symbolTable-testAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "testDetail"], workdir="build/TestSymbolTable", name='symbolTable-testDetail'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryAbstract"], workdir="build/TestSymbolTable", name='symbolTable-checkMemoryAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryDetail"], workdir="build/TestSymbolTable", name='symbolTable-checkMemoryDetail'))
factory.addStep(steps.ShellCommand(command=["make", "compileAbstract"], workdir="build/TestType", name='type-compileAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "compileDetail"], workdir="build/TestType", name='type-compileDetail'))
factory.addStep(steps.ShellCommand(command=["make", "runAbstract"], workdir="build/TestType", name='type-runAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "runDetail"], workdir="build/TestType", name='type-runDetail'))
factory.addStep(steps.ShellCommand(command=["make", "testAbstract"], workdir="build/TestType", name='type-testAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "testDetail"], workdir="build/TestType", name='type-testDetail'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryAbstract"], workdir="build/TestType", name='type-checkMemoryAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "checkMemoryDetail"], workdir="build/TestType", name='type-checkMemoryDetail'))
factory.addStep(steps.ShellCommand(command=["make", "coverageAbstract"], workdir="build/", name='coverageAbstract'))
factory.addStep(steps.ShellCommand(command=["make", "coverageDetail"], workdir="build/", name='coverageDetail'))
factory.addStep(steps.ShellCommand(command=["make", "clean"], workdir="build/", name='clean', description='cleaning', descriptionDone='cleaned'))
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="runtests",
workernames=["example-worker"],
factory=factory))
####### BUILDBOT SERVICES
# 'services' is a list of BuildbotService items like reporter targets. The
# status of each build will be pushed to these targets. buildbot/reporters/*.py
# has a variety to choose from, like IRC bots.
c['services'] = []
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "Sword"
c['titleURL'] = "https://github.com/Clcanny/Sword"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = "http://119.29.121.218:8010/"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={}),
# web interface with github notification entry point active
change_hook_dialects={'base': True, 'github': {'POST': True}})
####### DB URL
c['db'] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : "sqlite:///state.sqlite",
}
deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment