Show and Tell:
Our Gradle Build
Steve Pember
Director of Engineering, Klaviyo
Gr8Conf US 2018
@svpember
A Long
Time
Ago…
@svpember
So.
Simple.
@svpember
• 1. Checkout from Github
• 2. build war
@svpember
@svpember
Personally prefer Gradle over Maven
• DSL vs XML
• Task Graph vs sequential goals
• Incrementality
• Performance
@svpember
@svpember
Ha ha!
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
• Responsibilities of Jenkins
• Let’s look at some code
• What did I miss?
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
• Responsibilities of Jenkins
• Let’s look at some code
• What did I miss?
Continuous Deployment is your
Ultimate Goal
Is a Venn
Diagram
Appropriate?
Continuous Integration:
Software -> Quality Checks -> Artifact
@svpember
@svpember
Continuous Delivery ->
Reliable, Repeated Deploys
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
@svpember
Our Background
• Microservices
@svpember
Our Background
• Microservices
• Multi-Project builds
@svpember
@svpember
Our Background
• Microservices
• Multi-Project builds
• Jenkins Continuous Integration Pipelines
@svpember
@svpember
@svpember
@svpember
@svpember
Our Background
• Microservices
• Multi-Project builds
• Jenkins Continuous Integration Pipelines
• No Real Story on Continuous Delivery
Be Afraid.
Well…
it works…
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
Local Vs Remote Builds
@svpember
Local Vs Remote Builds
• Local: Fast, with some minimum level of acceptable testing
• Remote: thorough testing, with some minimal acceptable build time (15 min?)
• Your Gradle file will be more expressive than local needs
• Needs to support both Local and Remote in one build
@svpember
Parent vs Service Build File
• Parent: defines global config
• Parent: defines approved dependency versions, with excludes
• Service: local overrides
@svpember
Our (MY) Requirements:
• No building ‘final’ artifact from command line
• No deploying from command line
• Should act as guardrails for additional services and new engineers
@svpember
Quality Gate Checks
@svpember
Quality Gate Checks
@svpember
Quality Gate Checks
@svpember
Quality Gate Checks
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
• Responsibilities of Jenkins
@svpember
Jenkins Responsibilities
• Repository of Build History
• Integration / Communication
• Build Planning & Execution
• Environment Setup and Isolation
• Build Reporting
• Artifact Production
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
• Responsibilities of Jenkins
• Let’s look at some code
Walkthrough
@svpember
Remote
@svpember
@svpember
@svpember
@svpember
@svpember
@svpember
Fail
@svpember
Fail
@svpember
Success
@svpember
Success
@svpember
2 Main Take-aways
1. Pater Build plugin: provides parent POM behavior to your projects
2. Isolated Integration Builds: quality gate checks on every push
@svpember
Agenda
• Musings on Builds
• Some background on the situation at ThirdChannel
• Responsibilities of Gradle
• Responsibilities of Jenkins
• Let’s look at some code
• What did I miss?
Anyone want to share?
Thank You!
@svpember
@svpember
Images
• Table Flip: https://knowyourmeme.com/photos/170508-flipping-tables-%E2%95%AF%E2%96%A1%E2%95%AF%EF%B8%B5-
%E2%94%BB%E2%94%81%E2%94%BB
• Assembly Line: www.solidsmack.com/culture/humans-need-apply-new-short-film-explores-future-robots-manufacturing-automation/
• Poop Hieroglyphic: https://www.wired.com/story/history-of-poop-emoji/
• Civil War: http://nothingbutgeek.com/2016/05/captain-america-civil-war-story-featurette/
• Time Passing: https://themoodcatalogue.com/time-passes-by/o-time-passing-facebook/
• Golden Age / Athens: https://commons.wikimedia.org/wiki/File:School-of-athens2.jpg
• No, No, No: https://giphy.com/gifs/no-arrested-development-what-11NBUrJDuMd5As
• Box of Shame: https://giphy.com/gifs/shame-for-box-of-eP1fobjusSbu
• Pinnacle of the mountain: https://www.outdoorproject.com/adventures/vermont/showshoeing/stowe-pinnacle
• Statler and Waldorf: https://vignette.wikia.nocookie.net/muppet/images/3/3d/TMS-Statler%26Waldorf-BalconyBox.jpg
• CD vs CD: https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff
• Hexagonal Architecture: https://herbertograca.com/2017/09/14/ports-adapters-architecture/#what-is-an-adapter
• Canary deployments: http://electric-cloud.com/blog/2015/10/using-canary-releases-and-early-life-support-to-improve-production-releases/
• Sharing: http://business2government.com.au/marketing-to-government/shared-services-in-the-public-sector-lets-focus-on-service-delivery/
• Infinite loop: https://www.atlassian.com/blog/continuous-delivery/practical-continuous-deployment
@svpember
Links
• Parent Build example file: https://github.com/spember/gradle-parent-example

Gradle Show and Tell