How we integrate & deploy Mobile Apps with Travis CI

Marcio Klepacz
Marcio KlepacziOS Developer at GetYourGuide AG
How we integrate & deploy
Mobile Apps with Travis CI
Marcio Klepacz, iOS Engineering @ GetYourGuide
CocoaHeads Berlin 2015
Overview
  Who we are
  The Problem
  The Requirements
  The Solution
  Conclusion
Marcio Klepacz, GetYourGuide
Who we are
GetYourGuide Offers the Largest Travel
Activities Inventory Worldwide
Marcio Klepacz, GetYourGuide
800+
10,600+5,300+
800+
4,000+
2,000+
Marcio Klepacz, GetYourGuide
The Problem
  Repetitive
  Manual
  We want to automate that
  Fit our workflow
Developer Happiness
Marcio Klepacz, GetYourGuide
😄
Develop
😊	
  
Run
Tests
😐
Configure
😒	
  
Build
😠	
  
Write
release
notes
😤	
  
Upload,
notify
users,
etc.
The Requirements
Requirements
Marcio Klepacz, GetYourGuide
  Automatically build and test on push
  Fit into gitflow workflow (feature, develop and
release) branch
  Produce binaries that can be tested (downloaded)
Requirements / Gitflow
Marcio Klepacz, GetYourGuide
Requirements / Gitflow
Marcio Klepacz, GetYourGuide
Requirements / Gitflow
Marcio Klepacz, GetYourGuide
Requirements / Summary
Marcio Klepacz, GetYourGuide
  Build an Alpha App for Test Environment
  able to book with fake CC
  Build a Beta App for the Live Environment
  real content
  Build and test on every push
  Distribute app to testers from release and develop branches
  Relieve developers from repetitive manual tasks
Marcio Klepacz, GetYourGuide
Xcode	
  Server	
   Jenkins	
   Ship.io	
   Travis	
  CI	
  
iOS	
  and	
  
Android	
  
❌	
   ✅	
   ✅	
  
	
  
✅	
  
	
  
Ac,ons	
  
specific	
  to	
  
branches	
  
	
  
✅	
  
	
  
	
  
✅	
  
	
  
	
  
✅	
  
	
  
	
  
✅	
  
	
  
Build	
  on	
  
push	
  
✅	
  
	
  
✅	
  
	
  
✅	
  
	
  
✅	
  
	
  
Big	
  
community	
  
✅	
  
	
  
✅	
  
	
  
❌	
  
	
  
✅	
  
	
  
Hosted	
   ❌	
  
	
  
❌	
  
	
  
✅	
  
	
  
✅	
  
	
  
The Solution
Travis
Marcio Klepacz, GetYourGuide
  Hosted Continuous Integration service
  Configuration file in your project (.travis.yml)
  Define SDK, build env and output
  custom scripts
  Connected to Github
  Triggers in every push and pull request
  Available for many platforms
Travis Setup (.travis.yml)
Marcio Klepacz, GetYourGuide
  It’s not using the iPhone SDK
  code signing is needed
  Doesn’t differentiate between branches
  Doesn’t archive
  Doesn’t distribute
language: objective-c
xcode_project: MyNewProject.xcodeproj
xcode_scheme: MyNewProjectSharedScheme
iPhone SDK
custom build per branch
generate .ipa
distribute
Import keys (import-keys.sh)
# 1. Create keychain
security create-keychain -p travis ios-build.keychain
# 2. Make as default
security default-keychain -s ios-build.keychain
# 3. Unlock keychain
security unlock-keychain -p travis ios-build.keychain
# 4. Add certificates to keychain
security import ./ios-travis-ci/certificates/dist.cer -k ios-build.keychain -T /usr/bin/codesign
security import ./ios-travis-ci/certificates/dist.p12 -k ios-build.keychain -P $KEY_DIST_PASSWORD
-T /usr/bin/codesign
# 5. Copying provisioning profile to Travis
mkdir -p ~/Library/MobileDevice/Provisioning Profiles
cp ./ios-travis-ci/profiles/*.mobileprovision ~/Library/MobileDevice/Provisioning Profiles/
Marcio Klepacz, GetYourGuide
iPhone SDK
custom build per branch
generate .ipa
distribute
Import keys (import-keys.sh)
# 1. Create keychain
security create-keychain -p travis ios-build.keychain
# 2. Make as default
security default-keychain -s ios-build.keychain
# 3. Unlock keychain
security unlock-keychain -p travis ios-build.keychain
# 4. Add certificates to keychain
security import ./ios-travis-ci/certificates/dist.cer -k ios-build.keychain -T /usr/bin/codesign
security import ./ios-travis-ci/certificates/dist.p12 -k ios-build.keychain -P $KEY_DIST_PASSWORD
-T /usr/bin/codesign
# 5. Copying provisioning profile to Travis
mkdir -p ~/Library/MobileDevice/Provisioning Profiles
cp ./ios-travis-ci/profiles/*.mobileprovision ~/Library/MobileDevice/Provisioning Profiles/
⛔️️
Marcio Klepacz, GetYourGuide
iPhone SDK
custom build per branch
generate .ipa
distribute
Security
Marcio Klepacz, GetYourGuide
  You can encrypt environment variables using
Travis command line tool on your terminal:
~ $ travis ecrypt ‘KEY_DIST_PASSWORD=abc123’ –add
  Passing the option “--add” will automatically add the secure
key to your .travis.yml
env:
global:
- secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf
iPhone SDK
custom build per branch
generate .ipa
distribute
Travis Setup (.travis.yml)
Marcio Klepacz, GetYourGuide
  Use iPhone SDK ✅
  Doesn’t differentiate between branches
  Doesn’t archive
  Doesn’t distribute
language: objective-c
env:
global:
- secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf
before_script:
- ./scripts/import-key.sh
script:
- xctool -workspace MyNewProject.xcworkspace -scheme MySharedScheme -sdk iphoneos -configuration Beta
iPhone SDK
custom build per branch
generate .ipa
distribute
Building (build_app.sh)
# 1.
xctool -workspace ${APP_NAME}.xcworkspace 
-scheme ${APP_NAME} 
-sdk iphonesimulator test
…
# 2.
export RELEASE_SUFFIX=".release”
# Bundle Identifier:
# com.getyourguide.mobile.$(PRODUCT_NAME:rfc1034identifier)${BUNDLE_ID_SUFFIX}$
{RELEASE_SUFFIX}
…
# 3
xctool -workspace ${APP_NAME}.xcworkspace -scheme ${APP_NAME} 
-sdk iphoneos 
-configuration Debug 
OBJROOT=$PWD/build 
SYMROOT=$PWD/build
xctool -workspace ${APP_NAME}.xcworkspace -scheme ${APP_NAME} 
-sdk iphoneos 
-configuration Beta 
OBJROOT=$PWD/build 
SYMROOT=$PWD/build
Marcio Klepacz, GetYourGuide
iPhone SDK
custom build per branch
generate .ipa
distribute
Travis Setup (.travis.yml)
Marcio Klepacz, GetYourGuide
  Use iPhone SDK ✅
  Differentiate between branches ✅
  Doesn’t archive
  Doesn’t distribute
language: objective-c
env:
global:
- secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf
before_script:
- ./scripts/import-key.sh
script:
- ./scripts/build-app.sh
iPhone SDK
custom build per branch
generate .ipa
distribute
# 1.
xcrun -sdk iphoneos PackageApplication 
-v ”$BUILD_DIR/$APP_NAME.app" 
-o ”$BUILD_DIR/$APP_NAME.ipa" 
--sign "$DEVELOPER_NAME" 
--embed ”$PROVISIONING_PROFILE"
…
# 2.
release_notes=`git log --since=1.week --pretty=format:"%an - %s"`
curl 
-F status="2" 
-F notify="0" 
-F release_type="2" 
-F notes="$release_notes" 
-F notes_type="0" 
-F "ipa=@$outputdir/$APP_NAME.ipa" 
-F "mobileprovision=@$provisioning_profile" 
-H "X-HockeyAppToken: ${HOCKEY_APP_TOKEN}" 
https://rink.hockeyapp.net/api/2/apps/upload # Uploading to HockeyApp
Archiving and uploading
(archive_and_upload.sh)
Marcio Klepacz, GetYourGuide
iPhone SDK
custom build per branch
generate .ipa
distribute
Travis Setup (.travis.yml)
Marcio Klepacz, GetYourGuide
  Use iPhone SDK ✅
  Differentiate between branches ✅
  Archive ✅
  Doesn’t distribute ✅
language: objective-c
env:
global:
- secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf
before_script:
- ./scripts/import-key.sh
script:
- ./scripts/build-app.sh
after_success:
- ./scripts/archive_and_upload.sh
iPhone SDK
custom build per branch
generate .ipa
distribute
Move the scripts away from the app
repository (Optional)
Marcio Klepacz, GetYourGuide
  Maintenance 👍
  Reusable 👍
  Slower builds 👎
…
git:
submodules: false
before_install:
- git submodule init ios-travis-ci
- git submodule update --remote --merge ios-travis-ci
(Bonus) Overlaying Icons
Marcio Klepacz, GetYourGuide
  Add icon overlay script on the Build Phase of your target
IconOverlaying (by: Krzysztof Zabłocki)
…
before_install:
…
- brew install imagemagick && brew install ghostscript
Conclusion
Marcio Klepacz, GetYourGuide
  Automate tasks
  App is distributed
  No manual configuration
  Different actions between branches
  5 different apps to test concurrently
(@banaslee’s phone)
Thanks for your time
@marciok and marcio@getyourguide.com
References
Marcio Klepacz, GetYourGuide
Travis CI for iOS (Mattes Groeger)
johanneswuerbach / .travis.yml (Johannes Würbach)
The OS X Build Environment (Travis CI)
1 of 30

Recommended

How we integrate & deploy Mobile Apps with Travis CI part 2 by
How we integrate & deploy Mobile Apps with Travis CI part 2How we integrate & deploy Mobile Apps with Travis CI part 2
How we integrate & deploy Mobile Apps with Travis CI part 2Marcio Klepacz
689 views34 slides
Travis and fastlane by
Travis and fastlaneTravis and fastlane
Travis and fastlaneSteven Shen
2.4K views21 slides
Synack at AppSec California 2015 - Geolocation Vulnerabilities by
Synack at AppSec California 2015 - Geolocation VulnerabilitiesSynack at AppSec California 2015 - Geolocation Vulnerabilities
Synack at AppSec California 2015 - Geolocation VulnerabilitiesSynack
14.1K views56 slides
Intro to Continuous Integration at SoundCloud by
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudgarriguv
1.5K views100 slides
Virus Bulletin 2015: Exposing Gatekeeper by
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperSynack
3.6K views43 slides
DEF CON 23: Internet of Things: Hacking 14 Devices by
DEF CON 23: Internet of Things: Hacking 14 DevicesDEF CON 23: Internet of Things: Hacking 14 Devices
DEF CON 23: Internet of Things: Hacking 14 DevicesSynack
17.7K views88 slides

More Related Content

What's hot

Synack at ShmooCon 2015 by
Synack at ShmooCon 2015Synack at ShmooCon 2015
Synack at ShmooCon 2015Synack
3.7K views56 slides
Gatekeeper Exposed by
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper ExposedSynack
5K views67 slides
RSA OSX Malware by
RSA OSX MalwareRSA OSX Malware
RSA OSX MalwareSynack
1.2K views51 slides
OS X Malware: Let's Play Doctor by
OS X Malware: Let's Play DoctorOS X Malware: Let's Play Doctor
OS X Malware: Let's Play DoctorSynack
1.5K views50 slides
HotPush with Ionic 2 and CodePush by
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushEvan Schultz
4.8K views65 slides
selenium-2-mobile-web-testing by
selenium-2-mobile-web-testingselenium-2-mobile-web-testing
selenium-2-mobile-web-testinghugs
8.2K views39 slides

What's hot(20)

Synack at ShmooCon 2015 by Synack
Synack at ShmooCon 2015Synack at ShmooCon 2015
Synack at ShmooCon 2015
Synack3.7K views
Gatekeeper Exposed by Synack
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper Exposed
Synack5K views
RSA OSX Malware by Synack
RSA OSX MalwareRSA OSX Malware
RSA OSX Malware
Synack1.2K views
OS X Malware: Let's Play Doctor by Synack
OS X Malware: Let's Play DoctorOS X Malware: Let's Play Doctor
OS X Malware: Let's Play Doctor
Synack1.5K views
HotPush with Ionic 2 and CodePush by Evan Schultz
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePush
Evan Schultz4.8K views
selenium-2-mobile-web-testing by hugs
selenium-2-mobile-web-testingselenium-2-mobile-web-testing
selenium-2-mobile-web-testing
hugs8.2K views
Cross Platform Mobile Apps with the Ionic Framework by Troy Miles
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles1.5K views
Hardening Your Config Management - Security and Attack Vectors in Config Mana... by Peter Souter
Hardening Your Config Management - Security and Attack Vectors in Config Mana...Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Peter Souter1K views
CocoaHeads Rennes #13 : CocoaPods by CocoaHeadsRNS
CocoaHeads Rennes #13 : CocoaPodsCocoaHeads Rennes #13 : CocoaPods
CocoaHeads Rennes #13 : CocoaPods
CocoaHeadsRNS5K views
Rhodes mobile Framework by Yoshi Sakai
Rhodes mobile FrameworkRhodes mobile Framework
Rhodes mobile Framework
Yoshi Sakai1.4K views
Apache Cordova: Overview and Introduction by Gabriele Falasca
Apache Cordova: Overview and IntroductionApache Cordova: Overview and Introduction
Apache Cordova: Overview and Introduction
Gabriele Falasca3.9K views
iOS Auto Build by Ryan Wu
iOS Auto BuildiOS Auto Build
iOS Auto Build
Ryan Wu846 views
A Hacker's perspective on AEM applications security by Mikhail Egorov
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications security
Mikhail Egorov1.3K views
React native development with expo by SangSun Park
React native development with expoReact native development with expo
React native development with expo
SangSun Park1.3K views
Microservices, la risposta che (forse) cercavi! by Commit University
Microservices, la risposta che (forse) cercavi!Microservices, la risposta che (forse) cercavi!
Microservices, la risposta che (forse) cercavi!
Commit University242 views
Bootiful Development with Spring Boot and React - UberConf 2018 by Matt Raible
Bootiful Development with Spring Boot and React - UberConf 2018Bootiful Development with Spring Boot and React - UberConf 2018
Bootiful Development with Spring Boot and React - UberConf 2018
Matt Raible176 views

Viewers also liked

continious-integration-travisci-hockeyapp-android by
continious-integration-travisci-hockeyapp-androidcontinious-integration-travisci-hockeyapp-android
continious-integration-travisci-hockeyapp-androidScott Hutchinson
340 views1 slide
#speakgell - Continuous Integration in iconnect360 by
#speakgell - Continuous Integration in iconnect360#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360Derek Chan
573 views19 slides
HockeyApp for Nokia X by
HockeyApp for Nokia XHockeyApp for Nokia X
HockeyApp for Nokia XThomas Dohmke
907 views15 slides
Continuous deployments mobile apps by
Continuous deployments mobile appsContinuous deployments mobile apps
Continuous deployments mobile appsGeert van der Cruijsen
500 views15 slides
Xamariners: PRISM for Xamarin.Forms by
Xamariners: PRISM for Xamarin.FormsXamariners: PRISM for Xamarin.Forms
Xamariners: PRISM for Xamarin.FormsXamariners
1.5K views33 slides
Portable Class Library Deep Dive by
Portable Class Library Deep DivePortable Class Library Deep Dive
Portable Class Library Deep DiveJames Montemagno
1.4K views19 slides

Viewers also liked(9)

continious-integration-travisci-hockeyapp-android by Scott Hutchinson
continious-integration-travisci-hockeyapp-androidcontinious-integration-travisci-hockeyapp-android
continious-integration-travisci-hockeyapp-android
Scott Hutchinson340 views
#speakgell - Continuous Integration in iconnect360 by Derek Chan
#speakgell - Continuous Integration in iconnect360#speakgell - Continuous Integration in iconnect360
#speakgell - Continuous Integration in iconnect360
Derek Chan573 views
Xamariners: PRISM for Xamarin.Forms by Xamariners
Xamariners: PRISM for Xamarin.FormsXamariners: PRISM for Xamarin.Forms
Xamariners: PRISM for Xamarin.Forms
Xamariners1.5K views
Xamarin Forms Custom Renderers for the Rescue... by Udara Alwis
Xamarin Forms Custom Renderers for the Rescue...Xamarin Forms Custom Renderers for the Rescue...
Xamarin Forms Custom Renderers for the Rescue...
Udara Alwis4.5K views
Xcode Server & Xcode 7 Bots by Steven Forbes
Xcode Server & Xcode 7 Bots Xcode Server & Xcode 7 Bots
Xcode Server & Xcode 7 Bots
Steven Forbes5.3K views
52 tools for any company to innovate like a Startup /by @nickdemey @boardofinno by Board of Innovation
52 tools for any company to innovate like a Startup /by @nickdemey @boardofinno52 tools for any company to innovate like a Startup /by @nickdemey @boardofinno
52 tools for any company to innovate like a Startup /by @nickdemey @boardofinno
Board of Innovation369.7K views

Similar to How we integrate & deploy Mobile Apps with Travis CI

Advanced Mac Software Deployment and Configuration: Just Make It Work! by
Advanced Mac Software Deployment and Configuration: Just Make It Work!Advanced Mac Software Deployment and Configuration: Just Make It Work!
Advanced Mac Software Deployment and Configuration: Just Make It Work!Timothy Sutton
525 views65 slides
MobSecCon 2015 - Dynamic Analysis of Android Apps by
MobSecCon 2015 - Dynamic Analysis of Android AppsMobSecCon 2015 - Dynamic Analysis of Android Apps
MobSecCon 2015 - Dynamic Analysis of Android AppsRon Munitz
137 views30 slides
Pentesting Android Applications by
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android ApplicationsCláudio André
8.2K views36 slides
From printed circuit boards to exploits by
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploitsvirtualabs
69 views83 slides
Leveraging Continuous Integration For Fun And Profit! by
Leveraging Continuous Integration For Fun And Profit!Leveraging Continuous Integration For Fun And Profit!
Leveraging Continuous Integration For Fun And Profit!Jess Chadwick
1.3K views25 slides
GDGSCL - Docker a jeho provoz v Heroku a AWS by
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSLadislav Prskavec
2.4K views49 slides

Similar to How we integrate & deploy Mobile Apps with Travis CI(20)

Advanced Mac Software Deployment and Configuration: Just Make It Work! by Timothy Sutton
Advanced Mac Software Deployment and Configuration: Just Make It Work!Advanced Mac Software Deployment and Configuration: Just Make It Work!
Advanced Mac Software Deployment and Configuration: Just Make It Work!
Timothy Sutton525 views
MobSecCon 2015 - Dynamic Analysis of Android Apps by Ron Munitz
MobSecCon 2015 - Dynamic Analysis of Android AppsMobSecCon 2015 - Dynamic Analysis of Android Apps
MobSecCon 2015 - Dynamic Analysis of Android Apps
Ron Munitz137 views
Pentesting Android Applications by Cláudio André
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
Cláudio André8.2K views
From printed circuit boards to exploits by virtualabs
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploits
virtualabs69 views
Leveraging Continuous Integration For Fun And Profit! by Jess Chadwick
Leveraging Continuous Integration For Fun And Profit!Leveraging Continuous Integration For Fun And Profit!
Leveraging Continuous Integration For Fun And Profit!
Jess Chadwick1.3K views
GDGSCL - Docker a jeho provoz v Heroku a AWS by Ladislav Prskavec
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec2.4K views
How dorma+kaba leverages and deploys on CloudFoundry - CloudFoundry Summit Eu... by Adriano Raiano
How dorma+kaba leverages and deploys on CloudFoundry - CloudFoundry Summit Eu...How dorma+kaba leverages and deploys on CloudFoundry - CloudFoundry Summit Eu...
How dorma+kaba leverages and deploys on CloudFoundry - CloudFoundry Summit Eu...
Adriano Raiano413 views
One Click Provisioning With Enterprise Manager 12c by Josh Turner
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12c
Josh Turner306 views
Telerik AppBuilder Presentation for TelerikNEXT Conference by Jen Looper
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
Jen Looper874 views
Fastlane - Automation and Continuous Delivery for iOS Apps by Sarath C
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
Sarath C1.1K views
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree by RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeThe Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
RedBlackTree540 views
Making Security Agile by Oleg Gryb
Making Security AgileMaking Security Agile
Making Security Agile
Oleg Gryb1.4K views
CI CD Jenkins for Swift Deployment by Bintang Thunder
CI CD Jenkins for Swift DeploymentCI CD Jenkins for Swift Deployment
CI CD Jenkins for Swift Deployment
Bintang Thunder193 views
Pwning mobile apps without root or jailbreak by Abraham Aranguren
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreak
Abraham Aranguren12.1K views
Configure & send push notification on i os device by ShepHertz
Configure & send push notification on i os deviceConfigure & send push notification on i os device
Configure & send push notification on i os device
ShepHertz61 views
[Devoxx Morocco 2015] Apache Cordova In Action by Hazem Saleh
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
Hazem Saleh893 views
Ane for 9ria_cn by sonicxs
Ane for 9ria_cnAne for 9ria_cn
Ane for 9ria_cn
sonicxs366 views
Deploy your app with one Slack command by Fabio Milano
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
Fabio Milano655 views
Extending Appcelerator Titanium Mobile through Native Modules by omorandi
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
omorandi10.6K views

Recently uploaded

Scaling Knowledge Graph Architectures with AI by
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AIEnterprise Knowledge
50 views15 slides
"Running students' code in isolation. The hard way", Yurii Holiuk by
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk Fwdays
24 views34 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
61 views38 slides
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
45 views73 slides
"Surviving highload with Node.js", Andrii Shumada by
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
33 views29 slides
"Node.js Development in 2024: trends and tools", Nikita Galkin by
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin Fwdays
17 views38 slides

Recently uploaded(20)

"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays24 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays33 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays17 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi139 views
2024: A Travel Odyssey The Role of Generative AI in the Tourism Universe by Simone Puorto
2024: A Travel Odyssey The Role of Generative AI in the Tourism Universe2024: A Travel Odyssey The Role of Generative AI in the Tourism Universe
2024: A Travel Odyssey The Role of Generative AI in the Tourism Universe
Simone Puorto13 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn26 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10345 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman38 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely29 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views

How we integrate & deploy Mobile Apps with Travis CI

  • 1. How we integrate & deploy Mobile Apps with Travis CI Marcio Klepacz, iOS Engineering @ GetYourGuide CocoaHeads Berlin 2015
  • 2. Overview   Who we are   The Problem   The Requirements   The Solution   Conclusion Marcio Klepacz, GetYourGuide
  • 4. GetYourGuide Offers the Largest Travel Activities Inventory Worldwide Marcio Klepacz, GetYourGuide 800+ 10,600+5,300+ 800+ 4,000+ 2,000+
  • 7.   Repetitive   Manual   We want to automate that   Fit our workflow Developer Happiness Marcio Klepacz, GetYourGuide 😄 Develop 😊   Run Tests 😐 Configure 😒   Build 😠   Write release notes 😤   Upload, notify users, etc.
  • 9. Requirements Marcio Klepacz, GetYourGuide   Automatically build and test on push   Fit into gitflow workflow (feature, develop and release) branch   Produce binaries that can be tested (downloaded)
  • 10. Requirements / Gitflow Marcio Klepacz, GetYourGuide
  • 11. Requirements / Gitflow Marcio Klepacz, GetYourGuide
  • 12. Requirements / Gitflow Marcio Klepacz, GetYourGuide
  • 13. Requirements / Summary Marcio Klepacz, GetYourGuide   Build an Alpha App for Test Environment   able to book with fake CC   Build a Beta App for the Live Environment   real content   Build and test on every push   Distribute app to testers from release and develop branches   Relieve developers from repetitive manual tasks
  • 14. Marcio Klepacz, GetYourGuide Xcode  Server   Jenkins   Ship.io   Travis  CI   iOS  and   Android   ❌   ✅   ✅     ✅     Ac,ons   specific  to   branches     ✅       ✅       ✅       ✅     Build  on   push   ✅     ✅     ✅     ✅     Big   community   ✅     ✅     ❌     ✅     Hosted   ❌     ❌     ✅     ✅    
  • 16. Travis Marcio Klepacz, GetYourGuide   Hosted Continuous Integration service   Configuration file in your project (.travis.yml)   Define SDK, build env and output   custom scripts   Connected to Github   Triggers in every push and pull request   Available for many platforms
  • 17. Travis Setup (.travis.yml) Marcio Klepacz, GetYourGuide   It’s not using the iPhone SDK   code signing is needed   Doesn’t differentiate between branches   Doesn’t archive   Doesn’t distribute language: objective-c xcode_project: MyNewProject.xcodeproj xcode_scheme: MyNewProjectSharedScheme iPhone SDK custom build per branch generate .ipa distribute
  • 18. Import keys (import-keys.sh) # 1. Create keychain security create-keychain -p travis ios-build.keychain # 2. Make as default security default-keychain -s ios-build.keychain # 3. Unlock keychain security unlock-keychain -p travis ios-build.keychain # 4. Add certificates to keychain security import ./ios-travis-ci/certificates/dist.cer -k ios-build.keychain -T /usr/bin/codesign security import ./ios-travis-ci/certificates/dist.p12 -k ios-build.keychain -P $KEY_DIST_PASSWORD -T /usr/bin/codesign # 5. Copying provisioning profile to Travis mkdir -p ~/Library/MobileDevice/Provisioning Profiles cp ./ios-travis-ci/profiles/*.mobileprovision ~/Library/MobileDevice/Provisioning Profiles/ Marcio Klepacz, GetYourGuide iPhone SDK custom build per branch generate .ipa distribute
  • 19. Import keys (import-keys.sh) # 1. Create keychain security create-keychain -p travis ios-build.keychain # 2. Make as default security default-keychain -s ios-build.keychain # 3. Unlock keychain security unlock-keychain -p travis ios-build.keychain # 4. Add certificates to keychain security import ./ios-travis-ci/certificates/dist.cer -k ios-build.keychain -T /usr/bin/codesign security import ./ios-travis-ci/certificates/dist.p12 -k ios-build.keychain -P $KEY_DIST_PASSWORD -T /usr/bin/codesign # 5. Copying provisioning profile to Travis mkdir -p ~/Library/MobileDevice/Provisioning Profiles cp ./ios-travis-ci/profiles/*.mobileprovision ~/Library/MobileDevice/Provisioning Profiles/ ⛔️️ Marcio Klepacz, GetYourGuide iPhone SDK custom build per branch generate .ipa distribute
  • 20. Security Marcio Klepacz, GetYourGuide   You can encrypt environment variables using Travis command line tool on your terminal: ~ $ travis ecrypt ‘KEY_DIST_PASSWORD=abc123’ –add   Passing the option “--add” will automatically add the secure key to your .travis.yml env: global: - secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf iPhone SDK custom build per branch generate .ipa distribute
  • 21. Travis Setup (.travis.yml) Marcio Klepacz, GetYourGuide   Use iPhone SDK ✅   Doesn’t differentiate between branches   Doesn’t archive   Doesn’t distribute language: objective-c env: global: - secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf before_script: - ./scripts/import-key.sh script: - xctool -workspace MyNewProject.xcworkspace -scheme MySharedScheme -sdk iphoneos -configuration Beta iPhone SDK custom build per branch generate .ipa distribute
  • 22. Building (build_app.sh) # 1. xctool -workspace ${APP_NAME}.xcworkspace -scheme ${APP_NAME} -sdk iphonesimulator test … # 2. export RELEASE_SUFFIX=".release” # Bundle Identifier: # com.getyourguide.mobile.$(PRODUCT_NAME:rfc1034identifier)${BUNDLE_ID_SUFFIX}$ {RELEASE_SUFFIX} … # 3 xctool -workspace ${APP_NAME}.xcworkspace -scheme ${APP_NAME} -sdk iphoneos -configuration Debug OBJROOT=$PWD/build SYMROOT=$PWD/build xctool -workspace ${APP_NAME}.xcworkspace -scheme ${APP_NAME} -sdk iphoneos -configuration Beta OBJROOT=$PWD/build SYMROOT=$PWD/build Marcio Klepacz, GetYourGuide iPhone SDK custom build per branch generate .ipa distribute
  • 23. Travis Setup (.travis.yml) Marcio Klepacz, GetYourGuide   Use iPhone SDK ✅   Differentiate between branches ✅   Doesn’t archive   Doesn’t distribute language: objective-c env: global: - secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf before_script: - ./scripts/import-key.sh script: - ./scripts/build-app.sh iPhone SDK custom build per branch generate .ipa distribute
  • 24. # 1. xcrun -sdk iphoneos PackageApplication -v ”$BUILD_DIR/$APP_NAME.app" -o ”$BUILD_DIR/$APP_NAME.ipa" --sign "$DEVELOPER_NAME" --embed ”$PROVISIONING_PROFILE" … # 2. release_notes=`git log --since=1.week --pretty=format:"%an - %s"` curl -F status="2" -F notify="0" -F release_type="2" -F notes="$release_notes" -F notes_type="0" -F "ipa=@$outputdir/$APP_NAME.ipa" -F "mobileprovision=@$provisioning_profile" -H "X-HockeyAppToken: ${HOCKEY_APP_TOKEN}" https://rink.hockeyapp.net/api/2/apps/upload # Uploading to HockeyApp Archiving and uploading (archive_and_upload.sh) Marcio Klepacz, GetYourGuide iPhone SDK custom build per branch generate .ipa distribute
  • 25. Travis Setup (.travis.yml) Marcio Klepacz, GetYourGuide   Use iPhone SDK ✅   Differentiate between branches ✅   Archive ✅   Doesn’t distribute ✅ language: objective-c env: global: - secure: Pz3cxDffsdafasf34324fdsf232fdsfdsf3fdsf before_script: - ./scripts/import-key.sh script: - ./scripts/build-app.sh after_success: - ./scripts/archive_and_upload.sh iPhone SDK custom build per branch generate .ipa distribute
  • 26. Move the scripts away from the app repository (Optional) Marcio Klepacz, GetYourGuide   Maintenance 👍   Reusable 👍   Slower builds 👎 … git: submodules: false before_install: - git submodule init ios-travis-ci - git submodule update --remote --merge ios-travis-ci
  • 27. (Bonus) Overlaying Icons Marcio Klepacz, GetYourGuide   Add icon overlay script on the Build Phase of your target IconOverlaying (by: Krzysztof Zabłocki) … before_install: … - brew install imagemagick && brew install ghostscript
  • 28. Conclusion Marcio Klepacz, GetYourGuide   Automate tasks   App is distributed   No manual configuration   Different actions between branches   5 different apps to test concurrently (@banaslee’s phone)
  • 29. Thanks for your time @marciok and marcio@getyourguide.com
  • 30. References Marcio Klepacz, GetYourGuide Travis CI for iOS (Mattes Groeger) johanneswuerbach / .travis.yml (Johannes Würbach) The OS X Build Environment (Travis CI)