Introducing Continuous Integration for iOS
Aug 18, 2015
Introducing
Continuous Integration for iOS
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
Build proceess automation
Goals:
keep the build fast
make it easy to get the latest builds
(i.e. from Crashlytics)
avoid last-minute chaos at release dates
everyone can see the results of the latest builds
(s.c. big screen)
Build process automation
Test automation
Goals:
enforce discipline of frequent automated testing
automatically run the tests periodically or after
every push
report the results to the developers via email or Slack
Test automation
Code quality inspection
Goals:
introduction of coding rules
automated code analysis
automated search for potential bugs and code
duplications
Test automation
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
Xcode Server
Software from Apple that allows to apply the following
practices of continuous integration on the iOS and OS X
platforms:
build process automation
test automation
code quality inspection
Xcode Server
Considered platforms
Pros:
easy integration with iOS projects
direct configuration from developer's Xcode
free for Apple Developer Program members
free of charge tests on real devices
customizable and expandable with additional tools,
i.e. SonarQube
Xcode Server
Cons:
requires Mac
hermetic environment
lack of learning materials
Xcode Server
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
SonarQube
Open source platform for continuous inspection
of code quality.
SonarQube
Fastlane
Open source tool that:
enables automatic management of Apple certificates
and provisioning profiles
allows to deliver app packages directly to
iTunesConnect
Fastlane
Crashlytics
Platform that enables beta distribution of mobile
applications.
Crashlytics
Slack
Messaging platform for collaboration in team.
Slack
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
Bots
In Xcode you set up bots that run on the server
These bots process your apps, using the source code in
your remote repository, and report back the results
Bots can make builds, test your project or analyze your
project with the schemes you specify
Each run of a bot is called an integration, and these runs
occur regularly throughout the development life cycle
of your app
Bots
Manage Bots
On your development Mac, the Xcode report navigator
provides access to detailed information about your bots
and the integrations they've performed on the server.
Manage Bots
Report navigatorbutton
Create, edit and delete bots from the report navigator.
Manage Bots
Monitor Bots
You can view summaries of a bot’s integrations directly
from Slack...
Monitor Bots
You can view summaries of a bot’s integrations directly
from Slack...
Monitor Bots
...possible errors from Apple Developer Center as images...
Monitor Bots
...and summaries after uploading app to Crashlytics
or iTunesConnect.
Monitor Bots
How to customize bot?
Pre and Post integration scripts
How to customize bot?
Pre integration scripts
automatically increment build number using Apple
Generic versioning system
commit changes, create tag and push to remote
repository as an Xcode Server user
increment_build_number
automatically manage all project dependencies
using Cocoapods
keep up-to-date with newest releases of third-party
libraries
automatically integrate third-party libs to your project
cocoapods
manages certificates and provisioning profiles for
custom developer's account
beta_certificates - overlay for Codete default
Apple Enterprise Developer Account
release_certificates - overlay for Codete default
Apple AppStore Developer Account
certificates
Post integration scripts
performs static analysis of the procject's code
notifies developers about the result of analysis
sonarqube
uploads the .ipa file to Crashlytics
crashlytics
creates new iOS app on iTunesConnect
uploads the .ipa file to iTunesConnect
Appstore
sends integration results directly to company's
Slack channel
you can easily modify recepients
Slack
The benefits of Continuous Integration
Chosen platform
Additional tools
Workflow
Examples of use
Agenda
Examples of use
Examples of use
TESTS &ANALYSIS
BETA RELEASE
Examples of use - test and analysis bot
Before integration:
bash cocoapods
Before integration:
sonarqube
slack
Examples of use - beta bot
Before integration:
increment_build_number
cocoapods
beta_certificates
Before integration:
crashlytics
slack
Examples of use - release bot
Before integration:
increment_build_number
cocoapods
release_certificates
Before integration:
appstore
slack
Thank you for your attention