Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ c['protocols'] = {'pb': {'port': 9989}}
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot version of a python hello-world project.

apc = 'git@github.com:andreasofthings/apc.git'
web = 'git@github.com:andreasofthings/neumeier.org.git'
webapp = 'git@github.com:andreasofthings/pramari-app.git'

c['change_source'] = []
# c['change_source'].append(changes.github.GitHubPullrequestPoller('git://github.com/andreasofthings/apc.git', pollInterval=599))
# c['change_source'].append(changes.GitPoller(
Expand Down Expand Up @@ -143,32 +147,16 @@ c['schedulers'].append(schedulers.ForceScheduler(
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.

apc = 'git@github.com:andreasofthings/apc.git'
fetchapc = steps.Git(repourl=apc, mode='incremental')

web = 'git@github.com:andreasofthings/neumeier.org.git'
fetchweb = steps.Git(repourl=web, mode='incremental')

webapp = 'git@github.com:andreasofthings/pramari-app.git'
webapp_repo = steps.Git(repourl=webapp, mode='incremental', sshPrivateKey=util.Secret('id_rsa.webapp'), sshKnownHosts=util.Secret('known_hosts'))

factory = util.BuildFactory()
factory.addStep(fetchapc)
factory.addStep(steps.Git(repourl=apc, mode='incremental'))
factory.addStep(steps.PyFlakes(command=["pyflakes", "webapp"]))
factory.addStep(steps.PyLint(command=["pylint", "webapp"]))

test_factory = util.BuildFactory()
test_factory.addStep(fetchapc)
test_factory.addStep(steps.ShellCommand(command=["python", "manage.py", "test"], env={"GOOGLE_APPLICATION_CREDENTIALS": "pramari.json", "BUILDBOT": "True"}))


"""
Set CLOUDSDK_CONFIG to some temp directory
gcloud auth activate-service-account --key-file=...
... use gcloud to do your work ...
Remove temp CLOUDSDK_CONFIG directory.
"""

deploy_factory = util.BuildFactory()
deploy_factory.addStep(fetchapc)
deploy_factory.addStep(steps.ShellCommand(command=['gcloud', 'auth', 'activate-service-account', '--key-file=pramari.json'], env={'GCLOUDSDK_CONFIG': 'tmp'}))
Expand All @@ -192,14 +180,17 @@ static_factory.addStep(steps.ShellCommand(
))

web_factory = util.BuildFactory()
web_factory.addStep(fetchweb)
web_factory.addStep(steps.Git(repourl=web, mode='incremental'))
web_factory.addStep(steps.ShellCommand(command=["hugo",]))

webapp_factory = util.BuildFactory()
webapp_factory.addStep(steps.Git(repourl=webapp, mode='incremental', sshPrivateKey=util.Secret('id_rsa_webapp')))
webapp_factory.addStep(steps.Git(repourl=webapp, mode='incremental', sshPrivateKey=util.Secret('id_rsa.webapp'), sshKnownHosts=util.Secret('known_hosts')))
webapp_factory.addStep(steps.ShellCommand(command=['gcloud', 'auth', 'activate-service-account', '--key-file=pramari.json'], env={'GCLOUDSDK_CONFIG': 'tmp'}))
webapp_factory.addStep(steps.ShellCommand(command=['gcloud', 'app', 'deploy'], env={'GCLOUDSDK_CONFIG': 'tmp'}))

limitter_factory = util.BuildFactory()
limitter_factory.addStep(steps.ShellCommand(command=["gcloud", "app", "versions", "list", "--service", "default", "--sort-by", "'~version'", "--format", "'value(version.id)'"])

c['builders'] = []
c['builders'].append( util.BuilderConfig(name="Deploy AppEngine", workernames=["bot1", "bot2"], factory=deploy_factory))
c['builders'].append( util.BuilderConfig(name="Run Tests", workernames=["bot1", "bot2"], factory=test_factory))
Expand Down