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.5k
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
360
Exception Handling
nathankleyn
0
120
Cucumber Automation Testing
nathankleyn
3
210
Git: Everything You Need To Know (And A Few More Things)
nathankleyn
3
160
How The VM Works
nathankleyn
0
130
Other Decks in Programming
See All in Programming
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
120
Go1.25からのGOMAXPROCS
kuro_kurorrr
0
170
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
GoのGenericsによるslice操作との付き合い方
syumai
2
500
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
450
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
220
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
540
プロダクト開発でも使おう 関数のオーバーロード
yoiwamoto
0
150
FormFlow - Build Stunning Multistep Forms
yceruto
1
160
複数アプリケーションを育てていくための共通化戦略
irof
10
3.8k
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
190
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
170
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
43
2.4k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
How to Ace a Technical Interview
jacobian
276
23k
Being A Developer After 40
akosma
90
590k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Six Lessons from altMBA
skipperchong
28
3.8k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Raft: Consensus for Rubyists
vanstee
139
7k
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.