Quernus
Automated Feature
Branch Builds on iOS
Matt Hamilton
matt@quernus.co.uk
@hammertoe
Codemobile 19th April 2017
Who am I?
• 15 years as Technical
Director of web agency
• Python developer
• Now thrust into the world of
mobile
• Contractor, currently lead
of enquos mobile team
What is enquos?
iOS Build Process
• Long
• Arcane
• Requires variations
• Requires certificates / keys
Tools
Github
Fastlane / Gradle
Jenkins
Fabric Beta / Testflight
Slack
Fastlane
• Automates builds
• Allows multiple ‘lanes’ to be built
• Repeatable, scriptable builds
• An ‘API’ for iTunes Connect
• Takes the hassle out of the build and
deployment process
def do_build(scheme, configuration)
increment_build_number(
build_number: ENV['BUILD_ID']
)
profile =
'build/nutrition.mobileprovision'
if configuration == 'Release'
app_identifier =
'com.enquos.nutrition'
display_name =
'enquos nutrition'
set_istest_false
sigh(
app_identifier:
app_identifier,
filename: profile,
)
else
app_identifier =
'com.enquos.Nutrition.alpha.'
+ GIT_BRANCH_ID
display_name =
'enquos nutrition '
+ GIT_BRANCH
sigh(
app_identifier: '*',
adhoc: '1',
filename: profile,
)
end
update_info_plist(
app_identifier: app_identifier,
display_name: display_name,
plist_path:
'Nutrition/Info.plist',
xcodeproj:
'Nutrition/Nutrition.xcodeproj',
)
update_project_provisioning(
xcodeproj:
"Nutrition/Nutrition.xcodeproj",
build_configuration_filter:
".*Nutrition.*",
profile: profile,
)
ipa(
scheme: scheme,
configuration: configuration,
embed: profile,
xcargs:
'-derivedDataPath ./build',
)
end
Jenkins
• Monitors Github and builds a new
app when it sees a change
• Has separate jobs for:
• develop/
• feature/
• store
Quernus
A Typical Flow
Gotchas
• Need to change the App ID for watch app /
extensions too.
• Originally we used completely dynamic app ids,
but gets messy with 3rd party APIs (e.g.
Facebook) that need to know App ID in advance
Quernus
Thanks
Matt Hamilton
matt@quernus.co.uk
@hammertoe

Automating Feature Branch Builds on iOS and Android - Codemobile 2017 Lightning talk

  • 1.
    Quernus Automated Feature Branch Buildson iOS Matt Hamilton matt@quernus.co.uk @hammertoe Codemobile 19th April 2017
  • 2.
    Who am I? •15 years as Technical Director of web agency • Python developer • Now thrust into the world of mobile • Contractor, currently lead of enquos mobile team
  • 3.
  • 4.
    iOS Build Process •Long • Arcane • Requires variations • Requires certificates / keys
  • 5.
  • 6.
    Fastlane • Automates builds •Allows multiple ‘lanes’ to be built • Repeatable, scriptable builds • An ‘API’ for iTunes Connect • Takes the hassle out of the build and deployment process
  • 7.
    def do_build(scheme, configuration) increment_build_number( build_number:ENV['BUILD_ID'] ) profile = 'build/nutrition.mobileprovision' if configuration == 'Release' app_identifier = 'com.enquos.nutrition' display_name = 'enquos nutrition' set_istest_false sigh( app_identifier: app_identifier, filename: profile, ) else app_identifier = 'com.enquos.Nutrition.alpha.' + GIT_BRANCH_ID display_name = 'enquos nutrition ' + GIT_BRANCH sigh( app_identifier: '*', adhoc: '1', filename: profile, ) end update_info_plist( app_identifier: app_identifier, display_name: display_name, plist_path: 'Nutrition/Info.plist', xcodeproj: 'Nutrition/Nutrition.xcodeproj', ) update_project_provisioning( xcodeproj: "Nutrition/Nutrition.xcodeproj", build_configuration_filter: ".*Nutrition.*", profile: profile, ) ipa( scheme: scheme, configuration: configuration, embed: profile, xcargs: '-derivedDataPath ./build', ) end
  • 8.
    Jenkins • Monitors Githuband builds a new app when it sees a change • Has separate jobs for: • develop/ • feature/ • store
  • 13.
  • 16.
    Gotchas • Need tochange the App ID for watch app / extensions too. • Originally we used completely dynamic app ids, but gets messy with 3rd party APIs (e.g. Facebook) that need to know App ID in advance
  • 17.