continuous integration with robot sweatshop

20
ROBOT SWEATSHOP Lightweight, non-opinionated Continuous Integration

Upload: justin-scott

Post on 14-Aug-2015

256 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Continuous Integration with Robot Sweatshop

ROBOT SWEATSHOPLightweight, non-opinionated Continuous Integration

Page 2: Continuous Integration with Robot Sweatshop

WHOAMIgithub.com/JScott

Page 3: Continuous Integration with Robot Sweatshop

WHATAMIDOINGPlease send help

Page 4: Continuous Integration with Robot Sweatshop
Page 5: Continuous Integration with Robot Sweatshop
Page 6: Continuous Integration with Robot Sweatshop

JENKINS

… <builders> <hudson.tasks.Shell> <command>cd telusmkdir -p targetcucumber -p json_report</command> </hudson.tasks.Shell> </builders>…

Page 7: Continuous Integration with Robot Sweatshop

– a Jenkins user

“I’d rather work around a bad tool than maintain something new.”

Page 8: Continuous Integration with Robot Sweatshop

BUILDBOTfrom buildbot.process.factory import BuildFactoryfrom buildbot.steps.source import SVNfrom buildbot.steps.shell import ShellCommand

checkout = SVN(baseURL = '[email protected]:portal-project.git', mode = "update", username = "foo", password = "bar", haltOnFailure = True )

mkdir = ShellCommand(name = "mkdir -p telus/target", command = ["mkdir", "-p", "telus/target"], description = "make the results path")

cucumber = ShellCommand(name = "cucumber -p json_report", command = ["cucumber", "-p", "json_report"], description = "run Cucumber tests")

logresults = ShellCommand(name = "log-cucumber telus/target", command = ["log-cucumber", "telus/target"], description = "upload results")

factory = BuildFactory()factory.addStep(checkout)factory.addStep(mkdir)factory.addStep(cucumber)factory.addStep(logresults)

c['builders'] = [ BuilderConfig(name = "portal-project", slavenames = ['slave1', 'slave2', 'slave3'], factory = factory)]

Page 9: Continuous Integration with Robot Sweatshop

http://docs.buildbot.net/current/tutorial/fiveminutes.html

“Typically, at first sight it looks like a bunch of complicated concepts that make no sense and whose

relationships with each other are unclear.”

Page 10: Continuous Integration with Robot Sweatshop

STOP SUFFERING BAD TOOLS

We can do better

Page 11: Continuous Integration with Robot Sweatshop

ROBOT SWEATSHOP

jobs/portal-project.yaml---branch_whitelist: - develop

commands: - mkdir -p telus/target - cucumber -p json_report - log-cucumber telus/target

Page 12: Continuous Integration with Robot Sweatshop

SIDE-BY-SIDE CONFIGS<?xml version='1.0' encoding='UTF-8'?><project> <actions/> <description>requires these gems:&#xd;statsd-ruby&#xd;selenium-webdriver&#xd;cucumber&#xd;json&#xd;RMagick</description> <logRotator class="hudson.tasks.LogRotator"> <daysToKeep>10</daysToKeep> <numToKeep>-1</numToKeep> <artifactDaysToKeep>-1</artifactDaysToKeep> <artifactNumToKeep>-1</artifactNumToKeep> </logRotator> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.plugins.git.GitSCM" plugin="[email protected]"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url>[email protected]:webchannel/uss-cucumber.git</url> <credentialsId>ad5d9dcc-cb2f-42a4-8e9a-f47b3208ce0c</credentialsId> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name>*/develop</name> </hudson.plugins.git.BranchSpec> </branches> <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> <submoduleCfg class="list"/> <extensions> <hudson.plugins.git.extensions.impl.CloneOption> <shallow>true</shallow> <reference></reference> </hudson.plugins.git.extensions.impl.CloneOption> </extensions> </scm> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers> <hudson.triggers.TimerTrigger> <spec>H 11 * * *</spec> </hudson.triggers.TimerTrigger> </triggers> <concurrentBuild>false</concurrentBuild> <builders> <hudson.tasks.Shell> <command>cd telusmkdir -p targetcucumber -p json_report -p remote_ff</command> </hudson.tasks.Shell> </builders> <publishers> <org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver plugin="[email protected]"> <testResults>telus/target/features_report.json</testResults> </org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver> <hudson.tasks.Mailer plugin="[email protected]"> <recipients>[email protected] [email protected] [email protected] [email protected]</recipients> <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild> <sendToIndividuals>false</sendToIndividuals> </hudson.tasks.Mailer> </publishers> <buildWrapp

from buildbot.process.factory import BuildFactoryfrom buildbot.steps.source import SVNfrom buildbot.steps.shell import ShellCommand

checkout = SVN(baseURL = '[email protected]:portal-project.git', mode = "update", username = "foo", password = "bar", haltOnFailure = True )

mkdir = ShellCommand(name = "mkdir -p telus/target", command = ["mkdir", "-p", "telus/target"], description = "make the results path")

cucumber = ShellCommand(name = "cucumber -p json_report", command = ["cucumber", "-p", "json_report"], description = "run Cucumber tests")

logresults = ShellCommand(name = "log-cucumber telus/target", command = ["log-cucumber", "telus/target"], description = "upload results")

factory = BuildFactory()factory.addStep(checkout)factory.addStep(mkdir)factory.addStep(cucumber)factory.addStep(logresults)

c['builders'] = [ BuilderConfig(name = "portal-project", slavenames = ['slave1', 'slave2', 'slave3'], factory = factory)]

---branch_whitelist: - develop

commands: - mkdir -p telus/target - cucumber -p json_report - log-cucumber telus/target

67

33+

8

Page 13: Continuous Integration with Robot Sweatshop

USAGE DEMOhttps://asciinema.org/a/22878

http://localhost:10554

Page 14: Continuous Integration with Robot Sweatshop

THE FUTURERobot Sweatshop

• Output node

• Multiple workers easily

• Implicit job (done!)

• Non-TCP connections

• Worker Docker support

Sweatshop Gears

• Scaffolding scripts

• Custom repos

• Service hub

• Update/uninstall

• List/show

• Docker helper scripts

Page 15: Continuous Integration with Robot Sweatshop

QUESTIONS?robotsweat.com

But what about all the crunchy parts…?

Page 16: Continuous Integration with Robot Sweatshop

UNDER THE HOODovercoming some interesting challenges

Page 17: Continuous Integration with Robot Sweatshop

DISTRIBUTED ARCHITECTURE

github.com/kostya/eye

Page 18: Continuous Integration with Robot Sweatshop

JOB REQUEST RESILIENCE

Page 19: Continuous Integration with Robot Sweatshop

GEARS DEMOpackage management tool for non-core bits

https://asciinema.org/a/22878

Page 20: Continuous Integration with Robot Sweatshop

QUESTIONS?robotsweat.com