Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MCE - Continuous Integration

MCE - Continuous Integration

Rémy Virin

January 11, 2014
Tweet

Other Decks in Technology

Transcript

  1. #mceconf #mce-ciunithardware 11 Jan 2014 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 Million
  2. #mceconf #mce-ciunithardware 11 Jan 2014 C.I. BASICS Fetch sources Execute

    unit tests Publish app to mktg Generate metrics Generate Documentation Execute functional tests Workstations Continuous" Integration
  3. #mceconf #mce-ciunithardware 11 Jan 2014 ABOUT JENKINS ! •  Open

    Source (huge community) •  Easy to install •  Best known CI solution
  4. #mceconf #mce-ciunithardware 11 Jan 2014 CREATE A JOB ! • 

    Set  up  Github  url  and  restrict  where  the  job  should  be  run  if  your  mac  is  a   node  of  Jenkins.
  5. #mceconf #mce-ciunithardware 11 Jan 2014 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
  6. #mceconf #mce-ciunithardware 11 Jan 2014 PLUGINS vs SCRIPTS Most of

    the time, plugins are easier to use. Sometimes we have no choice but to use scripts Examples : • cocoapods plugin if podFile is not in root folder • run Unit tests with Xcode plugin
  7. #mceconf #mce-ciunithardware 11 Jan 2014 WE NEED TO KNOW WHEN

    BUILD FAILED •  Basic Alert : Email •  Growl Notification : Hudson-on-cocoa •  Or you can connect Jenkins to your real life…
  8. #mceconf #mce-ciunithardware 11 Jan 2014 YOU’LL NEVER BREAK THE BUILD

    AGAIN! Code source : https://github.com/codedance/Retaliation
  9. #mceconf #mce-ciunithardware 11 Jan 2014 SETUP - REQUIREMENTS ! • 

    A mac (at least 10.9)! •  OS X Server ! •  Xcode!
  10. #mceconf #mce-ciunithardware 11 Jan 2014 SETUP ! •  Install OS

    X Server and Xcode on your mac! •  Activate Xcode as a service on your server! •  Connect to remote repository! •  Create your first bot!
  11. #mceconf #mce-ciunithardware 11 Jan 2014 ERRORS DURING SETUP •  Error

    on getting source code -> no error, big logs for nothing! ! •  Add _teamserver public key to your Github repository (deploy keys)!
  12. #mceconf #mce-ciunithardware 11 Jan 2014 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)!
  13. #mceconf #mce-ciunithardware 11 Jan 2014 SETUP •  If you have

    to install your pods before building your app : •  $ sudo visudo -f /etc/sudoers •  Add these lines : # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL %_teamsserver ALL=(ALL) NOPASSWD: /usr/sbin/chown %_teamsserver ALL=(ALL) NOPASSWD: /usr/bin/pod
  14. #mceconf #mce-ciunithardware 11 Jan 2014 COOL THINGS ABOUT BOTS • 

    Bots Can be created and monitored from Xcode •  Integrate with Xcode •  UI and UX rocks •  Execute on remote mac
  15. #mceconf #mce-ciunithardware 11 Jan 2014 BAD THINGS ABOUT 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!
  16. #mceconf #mce-ciunithardware 11 Jan 2014 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!
  17. #mceconf #mce-ciunithardware 11 Jan 2014 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
  18. #mceconf #mce-ciunithardware 11 Jan 2014 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)