automate your build on android with jenkins
DESCRIPTION
By Mathieu Hausherr (@mhausherr) from Octo Technology http://blog.octo.com/en/TRANSCRIPT
![Page 1: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/1.jpg)
1
DEVELOPER MOBILE iOS Android Blackberry Bada Windows Phone7 Te c h Lead
Mathieu Hausherr [email protected]
![Page 2: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/2.jpg)
2
Continuous …
Continuous Integration
Continuous Delivery
Continuous Deployment
![Page 3: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/3.jpg)
3
! 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
Definitions
![Page 4: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/4.jpg)
4
Continuous Integration
![Page 5: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/5.jpg)
5
One developer
Source Repository Compile
Deploy
Execute Tests
Check Code Quality
Document
Package
Testing
![Page 6: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/6.jpg)
6
Many developers
Source Repository
Compile
Execute Tests
Check Code Quality
Document
Compile
Execute Tests
Check Code Quality
Document
Compile
Execute Tests
Check Code Quality
Document
Testing
![Page 7: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/7.jpg)
7
Remove the anarchy with a Software Factory
Source Repository
Testing
Compile
Deploy
Execute Tests
Check Code Quality
Document
Package
Continuous Integration Server
Notifications
![Page 8: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/8.jpg)
8
Advanced Software Factory
Source Repository
Continuous Integration Server
Notifications
Task and Issue Repository
Compile
Deploy
Execute Tests
Check Code Quality
Document
Package
Fetch Dependencies
Binary Repository
Documentation & KPIs
Test Platform
![Page 9: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/9.jpg)
9
1- Two things
ü Source repository
ü One machine to build
How ?
![Page 10: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/10.jpg)
10
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
How ?
Source : http://en.wikipedia.org/wiki/Continuous_integration
![Page 11: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/11.jpg)
11
Continuous Delivery
Continuous Deployment
![Page 12: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/12.jpg)
12
One big difference
Source : http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment
Team
1
Source Repository
2
Continuous Integration
Server
3
Tests (UAT, QA)
4
Deploy to production
5
Continuous Deployment auto
Continuous Delivery manual
![Page 13: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/13.jpg)
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
![Page 14: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/14.jpg)
14
! 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
What about mobile Apps ?
![Page 15: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/15.jpg)
15
! Improve TTM and feedback in real life
Why deploy continuously ?
IDEAS
CODE DATA
CODE FAST
MEASURE FAST
LEARN FAST
![Page 16: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/16.jpg)
16
! Deploy every day at 4PM to the product team
! Product team come on the open space at 4:30 and give feedbacks
Meetic sample
![Page 17: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/17.jpg)
17
! By decreasing deployment size ! Minimize risks ! Reduce the Mean Time To Repair (MTTR)
And quality ?
![Page 18: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/18.jpg)
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/
![Page 19: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/19.jpg)
19
http://localhost:8080/
![Page 20: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/20.jpg)
20
Install plugins
![Page 21: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/21.jpg)
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
MASTER SLAVE
execute the build on
![Page 22: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/22.jpg)
22
Source code + tests
Source code + tests
Continuous Integration SOFTWARE FACTORY
Application checked
SCM
Automatic func. tests
Work Station
Work Station
Building Application
Automatic dev. tests
Check Quality rules
Deployment
Publish metrics
Document
Documentation
![Page 23: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/23.jpg)
23
Source code + tests
Source code + tests
Continuous Integration on Android SOFTWARE FACTORY
Application checked
SCM
Automatic func. tests
Work Station
Work Station
Building Application
Automatic dev. tests
Check Quality rules
Deployment
Publish metrics
Document
Documentation
JAVADoc
LINT Emma
![Page 24: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/24.jpg)
24
Quality-tools for Android
BUILD
Android – Focus
github.com/stephanenicolas/Quality-Tools-for-Android
Junit forAndroid
TESTS VM
è Not running on JVM. Dalvik is necessary.
è Graphic environment and VirtualBox are necessary è No simultaneous run
![Page 25: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/25.jpg)
25
! Specific solutions exist to handle deployment on mobile devices
! Specific MAM actors
! MDM solution also have this features
! Many plugins available
Deployment
![Page 26: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/26.jpg)
26
Deployment
![Page 27: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/27.jpg)
27
CI Server on the cloud
![Page 28: Automate your build on Android with Jenkins](https://reader033.vdocument.in/reader033/viewer/2022061218/54b76a734a795971038b463f/html5/thumbnails/28.jpg)
28
GUI & Metrics
Unit tests
Readability