Automate your build on Android with Jenkins

1,768 views

Published on

By Mathieu Hausherr (@mhausherr) from Octo Technology http://blog.octo.com/en/

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,768
On SlideShare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
55
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Automate your build on Android with Jenkins

  1. 1. Te c h L e a d iOSAndroid DEVELOPER BlackberryBadaWindowsPhone7 MOBILE Mathieu Hausherr mha@octo.com 1
  2. 2. Continuous … Continuous Integration Continuous Delivery Continuous Deployment 2
  3. 3. Definitions ! Continuous Integration !   Each commit or per batch, the source code is : !   Compiled !   Tested !   Deployed on Integration environment ! Continuous Delivery !   Each commit or per batch, the source code is : !   […] !   Delivered to next team (QA, validation, production, …) ! Continuous Deployment !   Each commit or per batch, the source code is : !   […] !   Deployed on Production environment 3
  4. 4. Continuous Integration 4
  5. 5. One developer Source Repository Compile Testing Execute Tests Check Code Quality Package Deploy Document 5
  6. 6. Many developers Compile Execute Tests Check Code Quality Document Compile Execute Tests Check Code Quality Source Repository Document Testing Compile Execute Tests Check Code Quality Document 6
  7. 7. Remove the anarchy with a Software Factory Continuous Integration Server Source Repository Compile Execute Tests Check Code Quality Package Deploy Document Testing Notifications 7
  8. 8. Advanced Software Factory Continuous Integration Server Source Repository Fetch Dependencies Compile Binary Repository Execute Tests Check Code Quality Task and Issue Repository Package Test Platform Deploy Document Notifications Documentation & KPIs 8
  9. 9. How ? 1- Two things ü Source repository ü One machine to build 9
  10. 10. How ? 2- Many principles to apply : ü Maintain a code repository ü Automate the build ü Make the build self-testing ü Everyone commits more often ü Everyone can see the results of the latest build ü Automate deployment Source : http://en.wikipedia.org/wiki/Continuous_integration 10
  11. 11. Continuous Continuous Delivery Deployment 11
  12. 12. One big difference Continuous Delivery manual 2 1 Team 3 4 5 Source Repository Continuous Integration Server Tests (UAT, QA) Deploy to production Continuous Deployment auto Source : http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment 12
  13. 13. Samples (for the backend) 1 deployment per day ~10 deployments per day ~25 deployments per day ~50 deployments per day 1 deployment every 11 seconds 2009/2010 13
  14. 14. What about mobile Apps ? ! Continuous deployment, not continuous delivery ! Many factors prevent from doing continuous delivery !   On iOS and WP the Store validation process !   On Android the regression testing process is long !   Facebook is going for crowd testing on Android !   Android Beta Program !   New releases are marketed towards the users and they expect them ! !   “42 new levels for Candy Crush !” !   “A new hero in Clash of Clans !” !   “A new budget feature for my mobile banking app !” ! The emerging standard is going to release every month 14
  15. 15. Why deploy continuously ? ! Improve TTM and feedback in real life IDEAS LEARN FAST CODE FAST DATA CODE MEASURE FAST 15
  16. 16. Meetic sample ! Deploy every day at 4PM to the product team ! Product team come on the open space at 4:30 and give feedbacks 16
  17. 17. And quality ? ! By decreasing deployment size !   Minimize risks !   Reduce the Mean Time To Repair (MTTR) 17
  18. 18. Installing Jenkins ! Manual Installation !   Install Java ! Download jenkins.war !   Start the server ! Directly java –jar jenkins.war !  Or with a Java Web Application Server !   Jenkins is accessible at : http://localhost:8080/ 18
  19. 19. http://localhost:8080/ 19
  20. 20. Install plugins 20
  21. 21. Distributed jobs ! Sometimes the CI Server can’t execute the build directly on the server !   For example on windows it’s impossible to build Objective-C source code, you need a Mac for that. ! It’s the master/slave notion execute the build on MASTER SLAVE 21
  22. 22. Continuous Integration SOFTWARE FACTORY Automatic dev. tests Check Quality rules Work Station Publish metrics Source code + tests SCM Building Application Automatic func. tests Work Station Application checked Source code + tests Document Deploymen t Documentation 22
  23. 23. Continuous Integration on Android SOFTWARE FACTORY Automatic dev. tests Check Quality rules Work Station Source code + tests Publish metrics LINT Emma SCM Building Application Automatic func. tests Work Station Application checked Source code + tests Document Documentation Deploymen t JAVAD oc 23
  24. 24. Android – Focus TESTS BUILD Junit forAndroid Quality-tools for Android github.com/stephanenicolas/ Quality-Tools-for-Android VM è  è Graphic environment and VirtualBox are necessary è No simultaneous run Not running on JVM. Dalvik is necessary. 24
  25. 25. Deployment ! Specific solutions exist to handle deployment on mobile devices ! Specific MAM actors ! MDM solution also have this features ! Many plugins available 25
  26. 26. Deployment 26
  27. 27. CI Server on the cloud 27
  28. 28. GUI & Metrics Readability Unit tests 28

×