continuous integration by rémy virin
TRANSCRIPT
![Page 1: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/1.jpg)
CONTINUOUS INTEGRATION
FROM UNIT TESTS TO HARDWARE
Rémy VirinCocoaheads@remyvirin
![Page 2: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/2.jpg)
WHO AM I ? LIMA ?• I’m an iOS software engineer at Forget box.
• We’re creating a new way to store your data.
• Backed on kickstarter
• 12,8K backers• $ 1,2 Millions
![Page 3: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/3.jpg)
BEFORE, 10 YEARS AGO
One deviceOne User One Memory
![Page 4: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/4.jpg)
TODAY, MULTIPLE DEVICES, MULTIPLE MEMORIES
Multiple devices
One User Divided memories
![Page 5: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/5.jpg)
TODAY, CLOUD SOLUTION IS JUST A PATCH
Multiple devices
One User Divided memories
![Page 6: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/6.jpg)
TODAY, CLOUD SOLUTION IS JUST A PATCH
One User One Unified Memory
![Page 7: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/7.jpg)
CONTINUOUS INTEGRATION
FROM UNIT TESTS TO HARDWARE
![Page 8: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/8.jpg)
WHY ?
![Page 9: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/9.jpg)
![Page 10: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/10.jpg)
SHIP, SHIP, SHIIIIP !!!SHIP, SHIP, SHIIIIP !!!
![Page 11: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/11.jpg)
MEASURE QUALITY
• Photo quality
![Page 12: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/12.jpg)
HOW ?
![Page 13: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/13.jpg)
C.I. BASICS
Fetch sources
Execute unit tests
Publish app to mktg
Generate metrics
Generate Documentati
on
Execute functional tests
Workstations
ContinuousIntegration
![Page 14: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/14.jpg)
SAS vs LOCAL
![Page 15: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/15.jpg)
JENKINS
![Page 16: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/16.jpg)
ABOUT JENKINS
• Open Source
• Easy to install
• Best known CI solution
![Page 17: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/17.jpg)
INSTALL JENKINS
![Page 18: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/18.jpg)
ADD PLUGINS
![Page 19: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/19.jpg)
ADD PLUGINS
![Page 20: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/20.jpg)
CREATE A JOB
CREATE A JOB
![Page 21: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/21.jpg)
CREATE A JOB
• Set up Github url and restrict where the job should be run if your
mac is a node of Jenkins.
![Page 22: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/22.jpg)
CREATE A JOB WITH PLUGINS
![Page 23: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/23.jpg)
CREATE A JOB WITH A SCRIPT
Build your project, run Unit Tests, compute code coverage, package your app, deploy it etc…
$ pod install$ xcodebuild -workspace Lima.xcworkspace -scheme "Lima" -destination=build -configuration Debug_deploy -sdk iphoneos7.0 ONLY_ACTIVE_ARCH=YES clean build archive
$ xcodebuild -exportArchive -exportFormat "IPA" -archivePath "$NEW_ARCHIVE" -exportPath ./Lima.ipa -exportProvisioningProfile "Lima Adhoc Distribution"
# And then upload to testflight via curl
Full script here: https://gist.github.com/rvirin/7796647
![Page 24: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/24.jpg)
PLUGINS vs SCRIPTS
Most of the time, plugins are easier to use. Sometimes we don’t have other choices to use plugins
Examples : • cocoapods plugin if podFile is not in root folder• run Unit tests with Xcode plugin
![Page 25: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/25.jpg)
THAT’S IT, YOU CAN ENJOY NOW…
![Page 26: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/26.jpg)
AND ONE DAY, THE BUILD FAIL !
![Page 27: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/27.jpg)
WE NEED TO KNOW WHEN BUILD FAILED
• Basic Alert : Email
• Growl Notification : Hudson-on-cocoa
• Or you can connect Jenkins to your real life…
![Page 28: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/28.jpg)
YOU’LL NEVER BROKE THE BUILD AGAIN !
Code source : https://github.com/codedance/Retaliation
![Page 29: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/29.jpg)
BOTS ON iOS
![Page 30: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/30.jpg)
SETUP - REQUIREMENTS
• A mac (at least 10.9)• OS X Server • Xcode
![Page 31: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/31.jpg)
SETUP
• Install OS X Server and Xcode on your mac
• Activate Xcode as a service of your server
• Connect to remote repository• Create your first bot
![Page 32: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/32.jpg)
ERRORS DURING SETUP
• Error on getting source code -> no error, big logs for nothing
• Add _teamserver public key to your Github repository (deploy keys)
![Page 33: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/33.jpg)
ERRORS DURING SETUP
• CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0’ just trying to build the app !
• Get your provisionning profile on the mac server (Add your account to Xcode)
![Page 34: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/34.jpg)
SETUP
• If you have to install your pods before building your app :
• $ sudo visudo -f /etc/sudoers
• Add this line :# Same thing without a password# %wheel ALL=(ALL) NOPASSWD: ALL%_teamsserver ALL=(ALL) NOPASSWD: ALL
![Page 35: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/35.jpg)
• v
Source : Cocoapods mailing list
![Page 36: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/36.jpg)
PODS IN XCODE
•
![Page 37: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/37.jpg)
PODS IN XCODE
•
![Page 38: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/38.jpg)
COOL THINGS ON BOTS
• Bots Can be created and monitored from Xcode.
• Integrate with Xcode
• UI and UX rocks.
![Page 39: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/39.jpg)
BAD THINGS ON BOTS
• Lots of bugs
• Fetching pods before building app is painfull
• No 3rd party integration (Testflight, hockeyapp etc…)
• Can’t Archive an app
• Need to create a specific scheme
![Page 40: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/40.jpg)
SONARAn open source platform for
Continuous Inspection of code quality
![Page 41: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/41.jpg)
SONARQUBE
•
![Page 42: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/42.jpg)
SONARQUBE
• Issues with OCLint are powerfull
• Generate Documentation, Count lines of code, analyze code duplication and run Unit Tests !
• https://github.com/octo-technology/sonar-objective-c
![Page 43: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/43.jpg)
NEXT STEP : HARDWARENEXT STEP : HARDWARE
![Page 44: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/44.jpg)
CONCLUSION
![Page 45: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/45.jpg)
IMPROVEMENTS
• « Thanks to Jenkins I’m able to test the last version of our app just by pressing a button, it’s awesome ! » Alex Product Guy at Lima
![Page 46: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/46.jpg)
IMPROVEMENTS
• « Each day at 4pm, we get a new build of our app, it’s really efficient to reduce the amount of bugs » Tester at Meetic (Dating website)
![Page 47: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/47.jpg)
COST : 8 to 10 % of the project time
![Page 48: Continuous integration by Rémy Virin](https://reader034.vdocuments.net/reader034/viewer/2022052505/554dd588b4c905cc0e8b4b3a/html5/thumbnails/48.jpg)
THANKS !