SlideShare a Scribd company logo
Continuous Integration for your Android projects 
Sergii Zhuk 
Android Developer at DAXX BV 
Kyiv, UA Mobile 2014 
1
Agenda 
•CI in general 
•Popular CI systems and tools 
–Travis CI 
–Circle CI 
–Jenkins 
–Continuous Deployment 
•Demo projects 
•Q&A 
2
Continuous integration 
•Every developer keeps his work-in-progress continually integrated with every other developer 
•Requires build to be automated and self- testing 
•Makes results of the latest build visible 
3 
http://martinfowler.com/articles/continuousIntegration.html
•Making a build (periodically, triggered) 
•Running a unit and integration tests 
•Returning artifacts, test reports, code coverage reports etc. 
•Notifications 
•Deploying to continuous deployment tools 
4 
Practical outcomes that CI provides
Practical outcomes that CI provides 
5 
Illustration from https://www.jetbrains.com/teamcity/features/deployment.html
Travis CI: overview 
•Hosted, open-source 
•GitHub-only integration 
•Free for public GitHub repositories, starting from $129/mo for private ones 
•Easy to setup: always one .travis.yml file 
•Officially supports Android platform since 2014 
6
Travis CI: setup 
•Hosted Travis Webapp setup, add your GitHub account 
•.travis.yml configuration file 
•Validate your configuration file http://lint.travis-ci.org/ [yaml syntax] 
7
Travis CI: configuration options (1) 
•Programming language your project uses 
•Commands/scripts you want to be executed before each build (e.g. install dependencies) 
•Command is used to run test suite 
•Emails, Campfire and IRC rooms to notify about failures 
8
Travis CI: configuration options (2) 
•Code coverage (for Java/Android): external hosted tool Coveralls, uses JaCoCo reports, from $5/mo 
•Limited functionality in uploading artifacts, but friendly with Amazon S3 
•Scheduled builds only by external tool 
9
Travis CI: configuration example 
language: android android: components: # The BuildTools version used by your project - build-tools-19.1.0 # The SDK version used to compile your project - android-19 before_install: - chmod +x gradlew install: - ./gradlew assemble script: - ./gradlew test # For Robolectric tests 
10
Circle CI: overview 
•Hosted service 
•GitHub-only integration 
•Starts from $19/mo 
•Easy to setup: 2 additional files for Android 
•SSH access to build VM for 30 minutes after build 
11
•What programming language your project uses 
•What commands/scripts you want to be executed before each build (e.g. install dependencies) 
•What command is used to run test suite 
•Artifacts to collect 
•Nightly builds (using extra script) 
12 
Circle CI: configuration options
Circle CI: configuration (1): circle.yml 
13 
machine: environment: ANDROID_HOME: /usr/local/android-sdk-linux dependencies: cache_directories: - ~/.android - ~/android override: - bash install-dependencies.sh test: override: - chmod +x gradlew - ./gradlew assemble test 
Looks like Travis CI, doesn’t it?
Circle CI: configuration (2): dependencies script 
export PATH="$ANDROID_HOME/platform- tools:$ANDROID_HOME/tools:$PATH" DEPS="$ANDROID_HOME/installed-dependencies" if [ ! -e $DEPS ]; then echo y | android update sdk -u -a -t android-19 && echo y | android update sdk -u -a -t platform-tools && echo y | android update sdk -u -a -t extra && echo y | android update sdk -u -a -t build-tools-19.1.0 && touch $DEPS fi 
14
Jenkins: overview 
•Hudson  Jenkins 
•Open-Source 
•Java WebApp in container 
•Should be hosted on your private server 
•Multiple users, matrix permissions 
15
Jenkins: setup 
•Network-enabled server 
•Install Jenkins bundle with servlet container 
•Install Android SDK and support repos 
•Add Jenkins plugins for Git, Gradle etc. 
•Add your Git keys 
16
•Extremely flexible 
•Hundreds of plugins 
17 
Jenkins: configuration options
Jenkins: useful plugins 
•Android Lint plugin 
•HTML Report plugin 
•JaCoCo plugin 
•HockeyApp plugin 
•Google Play Android Publisher plugin 
18
Continuous deployment 
•Submit latest builds to test devices 
•TestFlight RIP 
19
Continuous deployment tools 
HockeyApp 
Appaloosa 
TestFairy 
Play Store 
Apphance 
Continuous deployment API 
X 
X 
X 
X 
X 
Mobile version 
X 
X 
X 
Distribution list permissioning 
X 
X 
X 
X 
Cost 
First month free, next from $30/mo 
Free, limited to 1 app and 10 users 
Free 
Registration fee 
Free, limited to 1 app and 50 devices 
20 
http://www.thoughtworks.com/insights/blog/testflight-alternatives-android
Some other CI products 
•CruiseControl : open-source, last updated in 2010 
•Ship.io (ex CIsimple) : hosted, easy to setup, but still a startup with bugs & limited functionality 
•TeamCity by JetBrains : good IntelliJ products integration, server-based, has free version 
•Atlassian Bamboo : good JIRA integration, starts from $10/month 
21
Demo: Example Android project 
•Simple 
•Gradle-based 
•Robolectric unit tests 
•Hosted on GitHub 
22
Demo 
23
Useful links 
•General 
http://martinfowler.com/articles/continuousIntegration.html 
https://devblog.toopher.com/2013/07/05/enabling-travis-ci-for-fun-and-profit/ 
http://ruenzuo.github.io/continuous-delivery-on-android-part-ii/index.html 
•Jenkins setup 
http://sanketdangi.com/post/62715793234/install-configure-jenkins-on-amazon-linux 
https://www.digitalocean.com/community/tutorials/how-to-build-android-apps-with-jenkins 
http://stackoverflow.com/questions/18045712/gradle-build-android-project-could-not- resolve-all-dependencies-error-but-i-t 
24
25 
Q&A
Thanks! 
Contact me: 
sergey.public@gmail.com 
http://ua.linkedin.com/in/sergiizhuk 
http://fb.com/sergii.zhuk 
26

More Related Content

ODP
Ci for-android-apps
PDF
Automated android testing using jenkins ci
PPTX
Genymotion with Jenkins
PDF
Tips for better CI on Android
PDF
Android + jenkins
PDF
Continous UI testing with Espresso and Jenkins
PPTX
Build Automation in Android
PDF
No more waiting for API - Android Stub Server
Ci for-android-apps
Automated android testing using jenkins ci
Genymotion with Jenkins
Tips for better CI on Android
Android + jenkins
Continous UI testing with Espresso and Jenkins
Build Automation in Android
No more waiting for API - Android Stub Server

What's hot (20)

PDF
Automate your build on Android with Jenkins
PPTX
Continuous Integration of Mobile Apps with Docker and Appium
PPTX
GitHub Actions for 5 minutes
KEY
Continuous Delivery Using Jenkins
PDF
Setup Build & Deploy with Jenkins CI
PPTX
Building the Test Automation Framework - Jenkins for Testers
PPTX
Continuous integration in games development
PPTX
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PDF
Fastlane - Automation and Continuous Delivery for iOS Apps
PDF
QAAgility Presentation - Cucumber with Appium
PDF
Automated-Testing-inside-containers
PPTX
Jenkins introduction
KEY
Testing with Jenkins, Selenium and Continuous Deployment
PPTX
Continuous integration using Bamboo
PPTX
Mobile UI Testing using Appium and Docker
PDF
Run your Appium tests using Docker Android - AppiumConf 2019
PPTX
Continuous integration using jenkins
PDF
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
PDF
Intro to Eclipse Che, by Tyler Jewell
PDF
Deploy your app with one Slack command
Automate your build on Android with Jenkins
Continuous Integration of Mobile Apps with Docker and Appium
GitHub Actions for 5 minutes
Continuous Delivery Using Jenkins
Setup Build & Deploy with Jenkins CI
Building the Test Automation Framework - Jenkins for Testers
Continuous integration in games development
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
Fastlane - Automation and Continuous Delivery for iOS Apps
QAAgility Presentation - Cucumber with Appium
Automated-Testing-inside-containers
Jenkins introduction
Testing with Jenkins, Selenium and Continuous Deployment
Continuous integration using Bamboo
Mobile UI Testing using Appium and Docker
Run your Appium tests using Docker Android - AppiumConf 2019
Continuous integration using jenkins
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
Intro to Eclipse Che, by Tyler Jewell
Deploy your app with one Slack command
Ad

Viewers also liked (10)

PDF
Gradle build automation tool
PPTX
20160915 automation with_gradle
PDF
Achieving 100% mobile test coverage perfecto mobile
PDF
Android Continuous Integration and Automation - Enrique Lopez Manas, Sixt
PDF
Using Jenkins as Native Packages Factory - Jenkins User Conference Paris 2012
PDF
Hands on continouous delivery, I TAKE 2014
PDF
Let’s start Continuous Integration with jenkins
PDF
Continuous Cross Platform Mobile App Development using Jenkins Build Server
PPTX
Jenkins - From Continuous Integration to Continuous Delivery
PPTX
Jenkins For One
Gradle build automation tool
20160915 automation with_gradle
Achieving 100% mobile test coverage perfecto mobile
Android Continuous Integration and Automation - Enrique Lopez Manas, Sixt
Using Jenkins as Native Packages Factory - Jenkins User Conference Paris 2012
Hands on continouous delivery, I TAKE 2014
Let’s start Continuous Integration with jenkins
Continuous Cross Platform Mobile App Development using Jenkins Build Server
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins For One
Ad

Similar to Continuous Integration for your Android projects (20)

PPTX
Agile Network India | Continuous Integration & Continuous Deployment & Automa...
PPTX
Continuous integration ( jen kins travis ci)
PDF
Continuous Integration
PPTX
Continuous integration
PDF
Show an Open Source Project Some Love and Start Using Travis-CI
PPT
Continuous Integration: A Case Study
PDF
Agile Bodensee - Testautomation & Continuous Delivery Workshop
PDF
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
PDF
Continuous Integration from server to cloud
PDF
TMF2014 CI-CD Workshop Michael Palotas
 
PDF
CI/CD Tools That Will Revolutionize Your DevOps Process
PDF
Apache Continuum Build, Test, and Release
PPT
Presentation 1 open source tools in continuous integration environment v1.0
PPTX
OVerview of Jenkins - A WIP pPT that needs to be refined
PPTX
Introduction to Continuous Integration
PPTX
Continuous integration for App developers
PDF
Survival of the Continuist
PDF
Quickstart for continuous integration
PDF
TRAVIS CI-KNOLX
Agile Network India | Continuous Integration & Continuous Deployment & Automa...
Continuous integration ( jen kins travis ci)
Continuous Integration
Continuous integration
Show an Open Source Project Some Love and Start Using Travis-CI
Continuous Integration: A Case Study
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
Continuous Integration from server to cloud
TMF2014 CI-CD Workshop Michael Palotas
 
CI/CD Tools That Will Revolutionize Your DevOps Process
Apache Continuum Build, Test, and Release
Presentation 1 open source tools in continuous integration environment v1.0
OVerview of Jenkins - A WIP pPT that needs to be refined
Introduction to Continuous Integration
Continuous integration for App developers
Survival of the Continuist
Quickstart for continuous integration
TRAVIS CI-KNOLX

Continuous Integration for your Android projects

  • 1. Continuous Integration for your Android projects Sergii Zhuk Android Developer at DAXX BV Kyiv, UA Mobile 2014 1
  • 2. Agenda •CI in general •Popular CI systems and tools –Travis CI –Circle CI –Jenkins –Continuous Deployment •Demo projects •Q&A 2
  • 3. Continuous integration •Every developer keeps his work-in-progress continually integrated with every other developer •Requires build to be automated and self- testing •Makes results of the latest build visible 3 http://martinfowler.com/articles/continuousIntegration.html
  • 4. •Making a build (periodically, triggered) •Running a unit and integration tests •Returning artifacts, test reports, code coverage reports etc. •Notifications •Deploying to continuous deployment tools 4 Practical outcomes that CI provides
  • 5. Practical outcomes that CI provides 5 Illustration from https://www.jetbrains.com/teamcity/features/deployment.html
  • 6. Travis CI: overview •Hosted, open-source •GitHub-only integration •Free for public GitHub repositories, starting from $129/mo for private ones •Easy to setup: always one .travis.yml file •Officially supports Android platform since 2014 6
  • 7. Travis CI: setup •Hosted Travis Webapp setup, add your GitHub account •.travis.yml configuration file •Validate your configuration file http://lint.travis-ci.org/ [yaml syntax] 7
  • 8. Travis CI: configuration options (1) •Programming language your project uses •Commands/scripts you want to be executed before each build (e.g. install dependencies) •Command is used to run test suite •Emails, Campfire and IRC rooms to notify about failures 8
  • 9. Travis CI: configuration options (2) •Code coverage (for Java/Android): external hosted tool Coveralls, uses JaCoCo reports, from $5/mo •Limited functionality in uploading artifacts, but friendly with Amazon S3 •Scheduled builds only by external tool 9
  • 10. Travis CI: configuration example language: android android: components: # The BuildTools version used by your project - build-tools-19.1.0 # The SDK version used to compile your project - android-19 before_install: - chmod +x gradlew install: - ./gradlew assemble script: - ./gradlew test # For Robolectric tests 10
  • 11. Circle CI: overview •Hosted service •GitHub-only integration •Starts from $19/mo •Easy to setup: 2 additional files for Android •SSH access to build VM for 30 minutes after build 11
  • 12. •What programming language your project uses •What commands/scripts you want to be executed before each build (e.g. install dependencies) •What command is used to run test suite •Artifacts to collect •Nightly builds (using extra script) 12 Circle CI: configuration options
  • 13. Circle CI: configuration (1): circle.yml 13 machine: environment: ANDROID_HOME: /usr/local/android-sdk-linux dependencies: cache_directories: - ~/.android - ~/android override: - bash install-dependencies.sh test: override: - chmod +x gradlew - ./gradlew assemble test Looks like Travis CI, doesn’t it?
  • 14. Circle CI: configuration (2): dependencies script export PATH="$ANDROID_HOME/platform- tools:$ANDROID_HOME/tools:$PATH" DEPS="$ANDROID_HOME/installed-dependencies" if [ ! -e $DEPS ]; then echo y | android update sdk -u -a -t android-19 && echo y | android update sdk -u -a -t platform-tools && echo y | android update sdk -u -a -t extra && echo y | android update sdk -u -a -t build-tools-19.1.0 && touch $DEPS fi 14
  • 15. Jenkins: overview •Hudson  Jenkins •Open-Source •Java WebApp in container •Should be hosted on your private server •Multiple users, matrix permissions 15
  • 16. Jenkins: setup •Network-enabled server •Install Jenkins bundle with servlet container •Install Android SDK and support repos •Add Jenkins plugins for Git, Gradle etc. •Add your Git keys 16
  • 17. •Extremely flexible •Hundreds of plugins 17 Jenkins: configuration options
  • 18. Jenkins: useful plugins •Android Lint plugin •HTML Report plugin •JaCoCo plugin •HockeyApp plugin •Google Play Android Publisher plugin 18
  • 19. Continuous deployment •Submit latest builds to test devices •TestFlight RIP 19
  • 20. Continuous deployment tools HockeyApp Appaloosa TestFairy Play Store Apphance Continuous deployment API X X X X X Mobile version X X X Distribution list permissioning X X X X Cost First month free, next from $30/mo Free, limited to 1 app and 10 users Free Registration fee Free, limited to 1 app and 50 devices 20 http://www.thoughtworks.com/insights/blog/testflight-alternatives-android
  • 21. Some other CI products •CruiseControl : open-source, last updated in 2010 •Ship.io (ex CIsimple) : hosted, easy to setup, but still a startup with bugs & limited functionality •TeamCity by JetBrains : good IntelliJ products integration, server-based, has free version •Atlassian Bamboo : good JIRA integration, starts from $10/month 21
  • 22. Demo: Example Android project •Simple •Gradle-based •Robolectric unit tests •Hosted on GitHub 22
  • 24. Useful links •General http://martinfowler.com/articles/continuousIntegration.html https://devblog.toopher.com/2013/07/05/enabling-travis-ci-for-fun-and-profit/ http://ruenzuo.github.io/continuous-delivery-on-android-part-ii/index.html •Jenkins setup http://sanketdangi.com/post/62715793234/install-configure-jenkins-on-amazon-linux https://www.digitalocean.com/community/tutorials/how-to-build-android-apps-with-jenkins http://stackoverflow.com/questions/18045712/gradle-build-android-project-could-not- resolve-all-dependencies-error-but-i-t 24
  • 26. Thanks! Contact me: sergey.public@gmail.com http://ua.linkedin.com/in/sergiizhuk http://fb.com/sergii.zhuk 26