SlideShare a Scribd company logo
1 of 100
Download to read offline
Continuous Integration at 
SoundCloud 
iOSDevUK september 2014 
! 
Vincent Garrigues 
@garriguv
What is CI?
“Continuous integration (CI) 
is the practice, in software 
engineering, of merging all 
developer working copies 
with a shared mainline 
several times a day.” 
http://en.wikipedia.org/wiki/Continuous_integration
• trunk based development 
• lots of testing 
• CI pipeline
Why CI?
• move fast 
• keep codebase healthy 
• ship reliable apps
• move fast 
• keep codebase healthy 
• ship reliable apps
• started from scratch 
• months in development 
• millions of users
iOS Crash Complaints (avg per Week) 
140 
105 
70 
35 
0 
April May June July August 
SoundCloud community team
How to get 
started?
Start simple and 
iterate
• run unit test suite 
• α and β versions 
• sign .app builds
Rake
require 'rake' 
! 
desc 'say Hello World!' 
task :hello do 
puts 'Hello World!' 
end
require 'rake' 
! 
desc 'say Hello World!' 
task :hello do 
puts 'Hello World!' 
end
require 'rake' 
! 
desc 'say Hello World!' 
task :hello do 
puts 'Hello World!' 
end
require 'rake' 
! 
desc 'say Hello World!' 
task :hello do 
puts 'Hello World!' 
end
Running the unit tests
use xcodebuild or xctool
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
test
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
test
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
test
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
test
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
test
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
clean
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" 
build
rake tasks 
• rake clean 
• rake build 
• rake test
α and β versions
User-defined build settings
Override user-defined 
build settings when 
running xcodebuild
xcodebuild 
-workspace ci.xcworkspace 
-scheme ci 
-configuration Debug 
-sdk iphonesimulator7.1 
-destination "platform=iOS Simulator,name=iPhone Retina (4-inch)” 
build
xcodebuild 
(…) 
VG_BUNDLE_ID=com.company.app-alpha 
build
xcodebuild 
(…) 
VG_BUNDLE_ID=com.company.app-alpha 
VG_DISPLAY_NAME=α 
build
xcodebuild 
(…) 
VG_BUNDLE_ID=com.company.app-alpha 
VG_DISPLAY_NAME=α 
VG_CODE_SIGNING="'iPhone 
Distribution: Vincent Garrigues'" 
build
Where can we store 
those settings?
We use a YAML file
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: &DEFAULTS 
app: &APP_DEFAULTS 
workspace: ci.xcworkspace 
scheme: ci 
configuration: Release 
display_name: ci-test 
bundle_identifier: com.company.ci-test 
codesign: &CODESIGN_DEFAULTS 
signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' 
provisioning_profile: provisioning/app_store.mobileprovision
defaults: 
(..) 
! 
alpha: 
<<: *DEFAULTS 
app: 
<<: *APP_DEFAULTS 
display_name: α 
bundle_identifier: com.company.ci-test-alpha 
codesign: 
<<: *CODESIGN_DEFAULTS 
provisioning_profile: provisioning/alpha.mobileprovision
defaults: 
(..) 
! 
alpha: 
<<: *DEFAULTS 
app: 
<<: *APP_DEFAULTS 
display_name: α 
bundle_identifier: com.company.ci-test-alpha 
codesign: 
<<: *CODESIGN_DEFAULTS 
provisioning_profile: provisioning/alpha.mobileprovision
defaults: 
(..) 
! 
alpha: 
<<: *DEFAULTS 
app: 
<<: *APP_DEFAULTS 
display_name: α 
bundle_identifier: com.company.ci-test-alpha 
codesign: 
<<: *CODESIGN_DEFAULTS 
provisioning_profile: provisioning/alpha.mobileprovision
rake build BUILD_ENV=alpha 
rake build BUILD_ENV=beta 
rake build BUILD_ENV=adhoc 
rake build BUILD_ENV=release
rake build BUILD_ENV=alpha 
rake build BUILD_ENV=beta 
rake build BUILD_ENV=adhoc 
rake build BUILD_ENV=release
rake build BUILD_ENV=alpha 
rake build BUILD_ENV=beta 
rake build BUILD_ENV=adhoc 
rake build BUILD_ENV=appstore
rake build creates a .app
We need a .ipa
xcrun
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
xcrun -v 
-sdk iphoneos 
PackageApplication 
ci-test-alpha.app 
-o ci-test-alpha.ipa 
--sign "iPhone Distribution: Vincent Garrigues" 
--embed provisioning/alpha.mobileprovision
rake sign
• rake clean 
• rake test 
• rake build 
• rake sign
How can we use 
those rake tasks?
• rake build sign BUILD_ENV=alpha 
• rake build sign BUILD_ENV=beta 
• rake build sign BUILD_ENV=adhoc
• rake build sign BUILD_ENV=alpha 
• rake build sign BUILD_ENV=beta 
• rake build sign BUILD_ENV=adhoc
• rake build sign BUILD_ENV=alpha 
• rake build sign BUILD_ENV=beta 
• rake build sign BUILD_ENV=adhoc
• rake build sign BUILD_ENV=alpha 
• rake build sign BUILD_ENV=beta 
• rake build sign BUILD_ENV=adhoc 
• rake build sign BUILD_ENV=appstore
Ad-Hoc and AppStore 
builds have the same 
bundle id
rake build BUILD_ENV=appstore 
ci-test-appstore.app 
ci-test-appstore.dSYM 
ci-test-appstore.dSYM.zip
rake build BUILD_ENV=appstore 
rake ipa BUILD_ENV=appstore 
ci-test-appstore.app 
ci-test-appstore.dSYM 
ci-test-appstore.dSYM.zip 
ci-test-appstore.ipa
rake build BUILD_ENV=appstore 
rake ipa BUILD_ENV=appstore 
rake ipa BUILD_ENV=adhoc 
ci-test-appstore.app 
ci-test-appstore.dSYM 
ci-test-appstore.dSYM.zip 
ci-test-appstore.ipa 
ci-test-adhoc.ipa
rake build BUILD_ENV=appstore 
rake ipa BUILD_ENV=appstore 
rake ipa BUILD_ENV=adhoc 
ci-test-appstore.app 
ci-test-appstore.dSYM 
ci-test-appstore.dSYM.zip 
ci-test-appstore.ipa 
ci-test-adhoc.ipa
rake build BUILD_ENV=appstore 
rake ipa BUILD_ENV=appstore 
rake ipa BUILD_ENV=adhoc 
ci-test-appstore.app 
ci-test-appstore.dSYM 
ci-test-appstore.dSYM.zip 
ci-test-appstore.ipa 
ci-test-adhoc.ipa
The same binary, 
signed twice
Sample project 
! 
github.com/garriguv/ci-test
• linter (Xcode project, data 
model, acceptance tests, 
ruby, ObjC) 
• static analysis 
• unit tests (ruby and ObjC) 
• acceptance tests 
• custom app icon 
• deploy to HockeyApp 
• …
Thank you! 
http://github.com/garriguv/ci-talk ! 
! 
Vincent Garrigues 
@garriguv

More Related Content

What's hot (7)

(Christian heilman) firefox
(Christian heilman) firefox(Christian heilman) firefox
(Christian heilman) firefox
 
Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.Refactoring Wunderlist. UA Mobile 2016.
Refactoring Wunderlist. UA Mobile 2016.
 
Applied Testing Heuristics in the Context of eBay
Applied Testing Heuristics in the Context of eBayApplied Testing Heuristics in the Context of eBay
Applied Testing Heuristics in the Context of eBay
 
Codemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsorCodemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsor
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deployment
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
 
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I) Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
 

Viewers also liked

环青海湖自行车行攻略
环青海湖自行车行攻略环青海湖自行车行攻略
环青海湖自行车行攻略
Qin Yue Chen
 
Organizationalchange 111212215251-phpapp01
Organizationalchange 111212215251-phpapp01Organizationalchange 111212215251-phpapp01
Organizationalchange 111212215251-phpapp01
Mehul Rasadiya
 

Viewers also liked (20)

Censurado Mtv
Censurado MtvCensurado Mtv
Censurado Mtv
 
Cbc p2 saldaña
Cbc p2 saldañaCbc p2 saldaña
Cbc p2 saldaña
 
BRE-CASE Seminarium 105 - Credit Crunch w Polsce
BRE-CASE Seminarium 105 - Credit Crunch w PolsceBRE-CASE Seminarium 105 - Credit Crunch w Polsce
BRE-CASE Seminarium 105 - Credit Crunch w Polsce
 
20 steps to build an awesome personal brand
20 steps to build an awesome personal brand20 steps to build an awesome personal brand
20 steps to build an awesome personal brand
 
Preliminary story board
Preliminary story boardPreliminary story board
Preliminary story board
 
15 Marzo - Festa piazzetta Santa Rosalia
15 Marzo - Festa piazzetta Santa Rosalia15 Marzo - Festa piazzetta Santa Rosalia
15 Marzo - Festa piazzetta Santa Rosalia
 
Beyond Big Binders: Teaching Portfolios in the Web 2.0 World
Beyond Big Binders: Teaching Portfolios in the Web 2.0 WorldBeyond Big Binders: Teaching Portfolios in the Web 2.0 World
Beyond Big Binders: Teaching Portfolios in the Web 2.0 World
 
Hardest Thing
Hardest ThingHardest Thing
Hardest Thing
 
Why recruit@vgsom
Why recruit@vgsomWhy recruit@vgsom
Why recruit@vgsom
 
Analiasis abc
Analiasis abcAnaliasis abc
Analiasis abc
 
Blog vine b2
Blog vine b2Blog vine b2
Blog vine b2
 
Kotler mm 13e_basic_03
Kotler mm 13e_basic_03Kotler mm 13e_basic_03
Kotler mm 13e_basic_03
 
环青海湖自行车行攻略
环青海湖自行车行攻略环青海湖自行车行攻略
环青海湖自行车行攻略
 
Microformats, an overview
Microformats, an overviewMicroformats, an overview
Microformats, an overview
 
Системы оценки рисков при катании вне трасс
Системы оценки рисков при катании вне трассСистемы оценки рисков при катании вне трасс
Системы оценки рисков при катании вне трасс
 
Organizationalchange 111212215251-phpapp01
Organizationalchange 111212215251-phpapp01Organizationalchange 111212215251-phpapp01
Organizationalchange 111212215251-phpapp01
 
Paul Worland, Director of Business Development at Emcor & Mark Turner, Consul...
Paul Worland, Director of Business Development at Emcor & Mark Turner, Consul...Paul Worland, Director of Business Development at Emcor & Mark Turner, Consul...
Paul Worland, Director of Business Development at Emcor & Mark Turner, Consul...
 
ICE ME Paper London 2012
ICE ME Paper  London 2012ICE ME Paper  London 2012
ICE ME Paper London 2012
 
Ontwikkeling online hulp en de rol van lvg-cliënten Wouter Wolters (E-hulp.nl...
Ontwikkeling online hulp en de rol van lvg-cliënten Wouter Wolters (E-hulp.nl...Ontwikkeling online hulp en de rol van lvg-cliënten Wouter Wolters (E-hulp.nl...
Ontwikkeling online hulp en de rol van lvg-cliënten Wouter Wolters (E-hulp.nl...
 
Intro to SSDP - West Virginia University Chapter
Intro to SSDP - West Virginia University ChapterIntro to SSDP - West Virginia University Chapter
Intro to SSDP - West Virginia University Chapter
 

Similar to Intro to Continuous Integration at SoundCloud

Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
Isaac Murchie
 

Similar to Intro to Continuous Integration at SoundCloud (20)

Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
Launch Arguments & NSUserDefaults by Franck Lefebvre
Launch Arguments & NSUserDefaults by Franck LefebvreLaunch Arguments & NSUserDefaults by Franck Lefebvre
Launch Arguments & NSUserDefaults by Franck Lefebvre
 
Ionic Framework
Ionic FrameworkIonic Framework
Ionic Framework
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
 
Appium workship, Mobile Web+Dev Conference
Appium workship,  Mobile Web+Dev ConferenceAppium workship,  Mobile Web+Dev Conference
Appium workship, Mobile Web+Dev Conference
 
How we integrate & deploy Mobile Apps with Travis CI
How we integrate & deploy Mobile Apps with Travis CIHow we integrate & deploy Mobile Apps with Travis CI
How we integrate & deploy Mobile Apps with Travis CI
 
selenium-2-mobile-web-testing
selenium-2-mobile-web-testingselenium-2-mobile-web-testing
selenium-2-mobile-web-testing
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
 
Dev ops for cross platform mobile modeveast 12
Dev ops for cross platform mobile   modeveast 12Dev ops for cross platform mobile   modeveast 12
Dev ops for cross platform mobile modeveast 12
 
Calabash for iPhone apps
Calabash for iPhone appsCalabash for iPhone apps
Calabash for iPhone apps
 
Workshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UXWorkshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UX
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
Web app
Web appWeb app
Web app
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
 
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
[QE 2018] Adam Stasiak – Nadchodzi React Native – czyli o testowaniu mobilnyc...
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
 
Web app
Web appWeb app
Web app
 
The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01The Usual Suspects - Red Hat Developer Day 2012-11-01
The Usual Suspects - Red Hat Developer Day 2012-11-01
 

Recently uploaded

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 

Intro to Continuous Integration at SoundCloud

  • 1.
  • 2. Continuous Integration at SoundCloud iOSDevUK september 2014 ! Vincent Garrigues @garriguv
  • 4. “Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day.” http://en.wikipedia.org/wiki/Continuous_integration
  • 5. • trunk based development • lots of testing • CI pipeline
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 16. • move fast • keep codebase healthy • ship reliable apps
  • 17. • move fast • keep codebase healthy • ship reliable apps
  • 18.
  • 19.
  • 20. • started from scratch • months in development • millions of users
  • 21. iOS Crash Complaints (avg per Week) 140 105 70 35 0 April May June July August SoundCloud community team
  • 22.
  • 23. How to get started?
  • 24. Start simple and iterate
  • 25. • run unit test suite • α and β versions • sign .app builds
  • 26.
  • 27. Rake
  • 28. require 'rake' ! desc 'say Hello World!' task :hello do puts 'Hello World!' end
  • 29. require 'rake' ! desc 'say Hello World!' task :hello do puts 'Hello World!' end
  • 30. require 'rake' ! desc 'say Hello World!' task :hello do puts 'Hello World!' end
  • 31. require 'rake' ! desc 'say Hello World!' task :hello do puts 'Hello World!' end
  • 34. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" test
  • 35. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" test
  • 36. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" test
  • 37. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" test
  • 38. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" test
  • 39. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean
  • 40. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build
  • 41. rake tasks • rake clean • rake build • rake test
  • 42. α and β versions
  • 43.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. Override user-defined build settings when running xcodebuild
  • 51. xcodebuild -workspace ci.xcworkspace -scheme ci -configuration Debug -sdk iphonesimulator7.1 -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)” build
  • 54. xcodebuild (…) VG_BUNDLE_ID=com.company.app-alpha VG_DISPLAY_NAME=α VG_CODE_SIGNING="'iPhone Distribution: Vincent Garrigues'" build
  • 55. Where can we store those settings?
  • 56. We use a YAML file
  • 57. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 58. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 59. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 60. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 61. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 62. defaults: &DEFAULTS app: &APP_DEFAULTS workspace: ci.xcworkspace scheme: ci configuration: Release display_name: ci-test bundle_identifier: com.company.ci-test codesign: &CODESIGN_DEFAULTS signing_identity: '"iPhone Distribution: Vincent Garrigues (X73EL3QFZB)"' provisioning_profile: provisioning/app_store.mobileprovision
  • 63. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name: α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  • 64. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name: α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  • 65. defaults: (..) ! alpha: <<: *DEFAULTS app: <<: *APP_DEFAULTS display_name: α bundle_identifier: com.company.ci-test-alpha codesign: <<: *CODESIGN_DEFAULTS provisioning_profile: provisioning/alpha.mobileprovision
  • 66. rake build BUILD_ENV=alpha rake build BUILD_ENV=beta rake build BUILD_ENV=adhoc rake build BUILD_ENV=release
  • 67. rake build BUILD_ENV=alpha rake build BUILD_ENV=beta rake build BUILD_ENV=adhoc rake build BUILD_ENV=release
  • 68. rake build BUILD_ENV=alpha rake build BUILD_ENV=beta rake build BUILD_ENV=adhoc rake build BUILD_ENV=appstore
  • 70. We need a .ipa
  • 71. xcrun
  • 72. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 73. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 74. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 75. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 76. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 77. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 78. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 79. xcrun -v -sdk iphoneos PackageApplication ci-test-alpha.app -o ci-test-alpha.ipa --sign "iPhone Distribution: Vincent Garrigues" --embed provisioning/alpha.mobileprovision
  • 81. • rake clean • rake test • rake build • rake sign
  • 82. How can we use those rake tasks?
  • 83.
  • 84. • rake build sign BUILD_ENV=alpha • rake build sign BUILD_ENV=beta • rake build sign BUILD_ENV=adhoc
  • 85. • rake build sign BUILD_ENV=alpha • rake build sign BUILD_ENV=beta • rake build sign BUILD_ENV=adhoc
  • 86. • rake build sign BUILD_ENV=alpha • rake build sign BUILD_ENV=beta • rake build sign BUILD_ENV=adhoc
  • 87. • rake build sign BUILD_ENV=alpha • rake build sign BUILD_ENV=beta • rake build sign BUILD_ENV=adhoc • rake build sign BUILD_ENV=appstore
  • 88. Ad-Hoc and AppStore builds have the same bundle id
  • 89. rake build BUILD_ENV=appstore ci-test-appstore.app ci-test-appstore.dSYM ci-test-appstore.dSYM.zip
  • 90. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore ci-test-appstore.app ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa
  • 91. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore rake ipa BUILD_ENV=adhoc ci-test-appstore.app ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa ci-test-adhoc.ipa
  • 92. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore rake ipa BUILD_ENV=adhoc ci-test-appstore.app ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa ci-test-adhoc.ipa
  • 93. rake build BUILD_ENV=appstore rake ipa BUILD_ENV=appstore rake ipa BUILD_ENV=adhoc ci-test-appstore.app ci-test-appstore.dSYM ci-test-appstore.dSYM.zip ci-test-appstore.ipa ci-test-adhoc.ipa
  • 94. The same binary, signed twice
  • 95. Sample project ! github.com/garriguv/ci-test
  • 96.
  • 97. • linter (Xcode project, data model, acceptance tests, ruby, ObjC) • static analysis • unit tests (ruby and ObjC) • acceptance tests • custom app icon • deploy to HockeyApp • …
  • 98.
  • 99.
  • 100. Thank you! http://github.com/garriguv/ci-talk ! ! Vincent Garrigues @garriguv