Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
On our CI and Builds
Search
Nathan Kleyn
March 03, 2015
Programming
0
2.6k
On our CI and Builds
Presentation to internal Engineering team on exactly how our builds and CI work.
Nathan Kleyn
March 03, 2015
Tweet
Share
More Decks by Nathan Kleyn
See All by Nathan Kleyn
Distributed ID Generation
nathankleyn
1
2.3k
Semantic Versioning With Git
nathankleyn
2
370
Exception Handling
nathankleyn
0
140
Cucumber Automation Testing
nathankleyn
3
230
Git: Everything You Need To Know (And A Few More Things)
nathankleyn
3
170
How The VM Works
nathankleyn
0
150
Other Decks in Programming
See All in Programming
CSC509 Lecture 11
javiergs
PRO
0
310
Kotlin 2.2が切り拓く: コンテキストパラメータで書く関数型DSLと新しい依存管理のかたち
knih
0
420
KoogではじめるAIエージェント開発
hiroaki404
1
480
r2-image-worker
yusukebe
1
170
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
260
CSC509 Lecture 13
javiergs
PRO
0
250
高単価案件で働くための心構え
nullnull
0
130
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
110
Building AI with AI
inesmontani
PRO
0
130
予防に勝る防御なし(2025年版) - 堅牢なコードを導く様々な設計のヒント / Growing Reliable Code PHP Conference Fukuoka 2025
twada
PRO
36
12k
FlutterKaigi 2025 システム裏側
yumnumm
0
1k
Chart.jsで長い項目を表示するときのハマりどころ
yumechi
0
110
Featured
See All Featured
Practical Orchestrator
shlominoach
190
11k
RailsConf 2023
tenderlove
30
1.3k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
24
1.6k
Automating Front-end Workflow
addyosmani
1371
200k
GraphQLとの向き合い方2022年版
quramy
49
14k
Typedesign – Prime Four
hannesfritz
42
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Fireside Chat
paigeccino
41
3.7k
Unsuck your backbone
ammeep
671
58k
Why Our Code Smells
bkeepers
PRO
340
57k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Transcript
On our CI and BUILDS HOW THEY WORK
Or: How shit gets built and deployed.
Builds involve:
GitHub ∙ CircleCI Ruby ∙ Thor Docker
And copious amounts of:
Swearing ∙ Fear Punching ∙ Hate Quiet Weeping
None
On the PROCESS OF BUILDING A COMMIT
The steps to build:
1. Make a commit.
2. Push to GitHub.
3. CircleCI is notified.
4. The build begins.
5. The Docker build begins.
6. The sanity build begins. (if master)
7. Deployment can begin.
On the PUSHING OF A COMMIT
GitHub receives your commit and dispatches a notification to CircleCI.
Cheers bro. Welcome blud. all of teh infos
CircleCI receives a payload of information telling it what commit
this was.
CircleCI starts a container up for the build.
Boom bitches.
It then looks for our circle.yml file.
Each step of this file is executed.
These steps execute a bunch of shell scripts in /circle.
These steps... ∙ Configure versions of software to use (Ruby,
Java, Kafka, HBase, etc). ∙ Restore the cache. ∙ Checkout the repository. ∙ Build all the projects. ∙ Test all the projects. ∙ Save all the artifacts to CircleCI.
We have three different kinds of builds:
Standard ∙ Docker Sanity
We tell it what scripts to use by passing a
MODE env var.
Demo: The CircleCI build scripts.
On the DOCKER BUILDS OUR CODE IN CONTAINERS
Quick Docker refresher:
Docker is built on the idea of containers.
Many container!
You build images. You deploy containers.
How it happens:
A second parameterised build is started for Docker.
These builds have whatever info they need passed as parameters.
It builds, tags and pushes the Docker images.
The building happens on a separate machine.
The pushed images are stored in the Docker registry.
When we deploy, we pull down these images and run
them (making containers!)
On BUILD SCRIPTS USING AND ABUSING THOR
Thor is a task framework.
I’m actually really sensitive and kind.
All of the things we do on CircleCI are Thor
tasks.
The Thor task sources are in /build-scripts/thor.
Each task is namespaced. thor foo:bar
You can get help for a task by running thor
help task.
All Thor tasks are just Ruby files. Thor is just
a nice DSL.
Demo: The Thor build scripts.
On COMMON PROBLEMS SOLVING COMMON ISSUES
Q: Gradle tasks hanging locally.
A: Start the Nexus server.
Q: Deployments fail as unable to pull from repository.
A: Start the Docker registry.
Q: Docker build fails with “no space left on device”.
A: Restart the Docker server, if it still fails call
for help.
Q: “Expected ID but got nil”.
A: (Sadly) Just retry the build. This is a Docker/library
bug that happens randomly.
Q: The tests are failing.
A: Your tests are shit. Fix your tests.
On BEING A BUILD EXPERT BECOME A ZOMG HACKER
Demo: How to find the build to deploy.
Demo: How to see what SHA is being built for
Docker.
Fin. I’m gonna eat your hairy legs.