Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
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
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
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
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