Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Travis and Fastlane
Search
Steven Shen
July 10, 2015
Technology
3
940
Travis and Fastlane
A brief introduction of travis and fastlane setup for iOS project in Cocoaheads Taipei
Steven Shen
July 10, 2015
Tweet
Share
More Decks by Steven Shen
See All by Steven Shen
From Taiwan to Silicon Valley
syshen
0
66
Xing's shareing in Evernote Taiwan Meetup
syshen
0
39
簡單學會 iOS 開發
syshen
3
360
A lightning talk about UICollectionView
syshen
1
86
Other Decks in Technology
See All in Technology
ハイテク休憩
sat
PRO
2
140
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
kargoの魅力について伝える
magisystem0408
0
200
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
150
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
110
Storage Browser for Amazon S3
miu_crescent
1
140
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
27
12k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Six Lessons from altMBA
skipperchong
27
3.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
We Have a Design System, Now What?
morganepeng
51
7.3k
Transcript
TRAVIS CI
% git add % git commit % git push Service
hook Mac VM Xcode • Build • Test • Deploy • Notify
Setup Availability Speed Easy Manual Cloud Private network Depends Medium
Trouble shooting Hard Easy Cost Free for open source ….. $129/month for private repo
Setup % gem install travis % vim .travis.yml language: objective-c
script: - make notifications: email: false
all: xcodebuild -arch "i386" -configuration "Debug" -sdk "iphonesimulator" build |
xcpretty
Code Sign • Encrypt your keys, certificates, and provisioning profiles.
• Commit encrypted files to github • Decrypt and install before build
% openssl aes-256-cbc -k "foo" -in certs/dist.cer -out certs/dist.cer.enc -a
% openssl aes-256-cbc -k "foo" -in certs/dist.p12 -out certs/dist.p12.enc -a % openssl aes-256-cbc -k "foo" -in certs/dev.cer -out certs/dev.cer.enc -a % openssl aes-256-cbc -k "foo" -in certs/dev.p12 -out certs/dev.p12.enc -a % openssl aes-256-cbc -k “foo” -in certs/AppStore.mobileprovision -out certs/AppStore.mobileprovision.enc -a % openssl aes-256-cbc -k “foo” -in certs/AdHoc.mobileprovision -out certs/AdHoc.mobileprovision.enc -a before_script: - openssl aes-256-cbc -k "$SECRET" -in certs/AdHoc.mobileprovision.enc -d -a -out certs/AdHoc.mobileprovision - openssl aes-256-cbc -k "$SECRET" -in certs/AppStore.mobileprovision.enc -d -a -out certs/AppStore.mobileprovision - openssl aes-256-cbc -k "$SECRET" -in certs/dist.cer.enc -d -a -out certs/dist.cer - openssl aes-256-cbc -k "$SECRET" -in certs/dist.p12.enc -d -a -out certs/dist.p12 - openssl aes-256-cbc -k "$SECRET" -in certs/dist.cer.enc -d -a -out certs/dist.cer - openssl aes-256-cbc -k "$SECRET" -in certs/dist.p12.enc -d -a -out certs/dist.p12 Encrypt Decrypt Export
% travis encrypt “SECRET=foo” --add env: global: - secure: eLo92Sw8KejuadMDTgY
+bMAPow3D4zqkhBqXm8oUDctZn3qOJ5iJgMrNxfhSUx+AX/ jiT07+U0vicHWRjGtkIGBeZJ8FVJL7NZQbIbqa80g0+MT4CNk4bumUphY0 w+OOzsY8V4OKR90mUmzz3bVN8/ROFBZygeYBdiLnmhoQ93E= - secure: fGoTHN29GtCiux/ aGJ2wm3NYtbyIRh0vnfoJafYdzWC6lj0PWrv0KVF31rHA56f7wPVLFnLrx 2UhNzZHfMaavD9QSGVYNOcE2AVXuaRWnMrKmCjAkCW/7qnePwxcgcQTV +zQJTV523G4nDbWQMoQ9wugzTsxhj+Ob+ZF0cGEXUA= Use command line
#!/bin/sh # create keychain security create-keychain -p travis ios-build.keychain security
default-keychain -s ios-build.keychain security unlock-keychain -p travis ios-build.keychain security set-keychain-settings -t 3600 -l ~/Library/Keychains/ios- build.keychain # Certificate & Private key security import ./certs/cert.cer -k ~/Library/Keychains/ios- build.keychain -T /usr/bin/codesign security import ./certs/key.p12 -k ~/Library/Keychains/ios- build.keychain -P "$KEY_PASSWORD" -T /usr/bin/codesign # Provisioning profiles mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp "./certs/AppStore.mobileprovision" ~/Library/MobileDevice/ Provisioning\ Profiles/ cp "./certs/AdHoc.mobileprovision" ~/Library/MobileDevice/ Provisioning\ Profiles/
language: objective-c osx_image: xcode6.4 before_install: - gem install fastlane before_script:
- openssl aes-256-cbc -k "$SECRET" -in certs/EMQAppStore.mobileprovision.enc -d -a -out certs/ EMQAppStore.mobileprovision - openssl aes-256-cbc -k "$SECRET" -in certs/EMQDev.mobileprovision.enc -d -a -out certs/ EMQDev.mobileprovision - openssl aes-256-cbc -k "$SECRET" -in certs/cert.cer.enc -d -a -out certs/cert.cer - openssl aes-256-cbc -k "$SECRET" -in certs/dev-cert.cer.enc -d -a -out certs/dev-cert.cer - openssl aes-256-cbc -k "$SECRET" -in certs/key.p12.enc -d -a -out certs/key.p12 - openssl aes-256-cbc -k "$SECRET" -in certs/dev-key.p12.enc -d -a -out certs/dev-key.p12 - sh ./certs/install-keys.sh script: - make podfile: iOSApp/Podfile notifications: email: false slack: emq-inc:kPgGUXItHsgRsNtc77Fz3f3P env: global: - secure: OqyOY/I8QoucKb4uWY9xu9pkXgFoTahqiRl3BLOCJEbgKMKoUyDnk7N/ALktHp2S/NuB4zj5PNA50Lhb/ zAnI7cTgZT0qEDJv2yDIM/j0wQFEHbKQafEHDWj2vAnook8OBpXiiykqWIb1dKgXCjzcEDjxhSo5V6V5IsdFHVAAew= - secure: gAw0juDvfHolj0zg93f2qnCFBxetvFIBTsMCgHMzStk0DyKrsh4IV +1x2CCqSFWo5q4EbXmsKKeyQKqfreIbbQTmZkAmXjIiVg70LDVgsqk5COWUTRgn21pUGWUFosxAkSZZghEf0o3Z62jA6FgeJkCkP cSLszuE0Qlbiq0SFSw= - secure: eLo92Sw8KejuadMDTgY+bMAPow3D4zqkhBqXm8oUDctZn3qOJ5iJgMrNxfhSUx+AX/ jiT07+U0vicHWRjGtkIGBeZJ8FVJL7NZQbIbqa80g0+MT4CNk4bumUphY0w+OOzsY8V4OKR90mUmzz3bVN8/ ROFBZygeYBdiLnmhoQ93E= - secure: fGoTHN29GtCiux/ aGJ2wm3NYtbyIRh0vnfoJafYdzWC6lj0PWrv0KVF31rHA56f7wPVLFnLrx2UhNzZHfMaavD9QSGVYNOcE2AVXuaRWnMrKmCjAkCW /7qnePwxcgcQTV+zQJTV523G4nDbWQMoQ9wugzTsxhj+Ob+ZF0cGEXUA=
None
None
xcodebuild -arch "i386" -configuration "Debug" - sdk "iphonesimulator" build |
xcpretty fastlane build
Setup % sudo gem install fastlane % fastlane init %
vim fastlane/Appfile % vim fastlane/Fastfile
def unit_test xctest( workspace: 'EMQ.xcworkspace', scheme: 'EMQ-Demo', configuration: 'Demo', sdk:
"iphonesimulator", arch: "i386", reports:[{ report: 'html', output: './test-report.html' }] ) slack( message: 'EMQ iOS App Unit Test', channel: '#dev-ios', default_payloads: [:test_result, :git_branch, :git_author, :last_git_commit], ) end before_all do ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABCDEFG/ABCDEFG/ABCDEFG" clean_build_artifacts cocoapods end
lane :deliver_demo do #increment_build_number sigh xcodebuild( workspace: 'EMQ.xcworkspace', configuration: 'Demo',
scheme: 'EMQ-Demo', identity: 'iPhone Distribution: EMQ Limited (28HUT34N52)', clean: true ) unit_test xcarchive( workspace: 'EMQ.xcworkspace', configuration: 'Demo', scheme: 'EMQ-Demo', embed: '../certs/EMQAppStore.mobileprovision', identity: 'iPhone Distribution: EMQ Limited (28HUT34N52)' ) xcexport resign( ipa: 'EMQ-Demo.ipa', signing_identity: 'iPhone Distribution: EMQ Limited (28HUT34N52)', provisioning_profile: '../certs/EMQAppStore.mobileprovision', ) testflight(skip_deploy: true) end
None
all: ifeq ($(TRAVIS_PULL_REQUEST), false) fastlane test else agvtool new-version -all
$(TRAVIS_BUILD_NUMBER) fastlane deliver_demo endif
xcodebuild -arch "i386" -configuration "Debug" -sdk "iphonesimulator" build | xcpretty
fastlane build Trouble shooting
None
• Easy setup • No maintenance • Github integration •
Bad for trouble shooting • Automate your flows • Flexible, customizable • Life saver • Great for CI