James Earl Douglas
August 8, 2014
In this talk, we look at how a Scala development team can work collaboratively to build, test, and deploy their software.
How long would it take your organization to deploy a change that involves just one single line of code?
Do you deploy changes at this pace on a repeatable, reliable basis?
- Poppendieck
This approach has been successful in the development of multiple open source projects.
"DevOps"
10 GOTO 10
Keep sh*t running.
Ensure stakeholder happiness.
New development; new branch.
$ git checkout -b issue-5
Fully specify the desired feature, including how to use it.
Make something break before fixing it.
$ sbt test
...
[info] - add a bunch of numbers *** FAILED ***
[info] - don't add no numbers *** FAILED ***
...
[error] Failed: Total 2, Failed 2, Errors 0, Passed 0
We'll use a Servlet with sbt and xsbt-web-plugin.
Let's make the test pass.
Bingo.
$ sbt test
...
[info] - add a bunch of numbers
[info] - don't add no numbers
...
[info] Passed: Total 2, Failed 0, Errors 0, Passed 2
It's not pretty (yet), but we'll get there.
$ sbt scoverage:test
...
[info] - add a bunch of numbers
...
outputDir:/home/james/code/scala-cd/target/scala-2.10/scoverage-report
...
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
Here's a sneak preview.
The code is ready for peer review.
Push the new branch.
$ git push origin issue-5
Open a new pull request.
The tests
The implementation
We need to side-step into CI before we can wrap up our collaborative development process.
Asking experts to do boring and repetitive, and yet technically demanding tasks is the most certain way of ensuring human error that we can think of, short of sleep deprivation, or inebriation.
- Humble, Farley
Does the build pass?
Merge that PR!
Who's driving this thing!?
developer --> GitHub --> Travis CI ----> GitHub
\
`--> Coveralls
continuous deployment ≈ continuous integration + some kind of publishing
developer --> GitHub --> Travis CI ----> GitHub
\ \ \
\ \ `--> Coveralls
\ \
\ `---> Bintray
\
`----> Heroku
Verify the feature.
$ curl scala-cd.herokuapp.com/add?1,2,3,4,5,6,6,7,8
42
Check for reasonable failures.
$ curl -i scala-cd.herokuapp.com/add?one,two
HTTP/1.1 500 Internal Server Error
Test for acceptable performance.
$ ab -n 500 -c 50 scala-cd.herokuapp.com/add?1,2,3,4,5,6,6,7,8
...
Concurrency Level: 50
Time taken for tests: 2.956 seconds
Complete requests: 500
Failed requests: 0
Total transferred: 69500 bytes
Requests per second: 169.14 [#/sec] (mean)
Time per request: 295.616 [ms] (mean)
How long would it take your organization to deploy a change that involves just one single line of code?
Minutes.
Do you deploy changes at this pace on a repeatable, reliable basis?
Yes.
How?
Books