Upgrade to Pro — share decks privately, control downloads, hide ads and more …

動作確認のための社内アプリ配信サービスを新たに作った話 / iOSDC 2018

Tomohiro Moro
September 01, 2018

動作確認のための社内アプリ配信サービスを新たに作った話 / iOSDC 2018

iOSDC 2018 9/1 16:20〜 Track C の発表資料です。

Tomohiro Moro

September 01, 2018
Tweet

More Decks by Tomohiro Moro

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ໜ࿊ ஐେ / @slightair • ΫοΫύουגࣜձࣾ ٕज़෦ ϞόΠϧج൫άϧʔϓॴଐ

    • ࣾ಺ͷ։ൃ؀ڥ੔උɺαʔϏε։ൃ෦ॺͷٕज़తࢧԉ͕ۀ຿ 2
  2. TestFlight • ങऩલ͸େม͓ੈ࿩ʹͳ͍ͬͯͨ • Apple ެࣜͷ࢓૊Έ • ࣾ಺഑৴Ͱ͸ Internal Tester

    ͕༻్ͱ͍͚ۙΕͲ • ࢲ෺Ͱ࢖͍ͬͯΔ AppleID ΛձࣾͷνʔϜʹొ࿥ͨ͘͠ͳ͍ • ٯʹձࣾͰऔͬͨ AppleID Λࢲ෺ͷ iPhone ʹೖΕͯ࢖͏͔ͱ͍͏ͱɺͦ͏΋ͳΒͳ͍1 • ͙͢ʹෆ࠾༻ʹͳͬͨ 1 Android/PlayStoreͷํ͸ΞΧ΢ϯτपΓͷ༥௨͕ޮ͖ͦ͏ͩͬͨɻAlphaϦϦʔεͷػೳ͸ར༻Ͱ͖ͦ͏ɻ 7
  3. ಉ͡ΞϓϦͰ΋ෳ਺ͷઃఆͰ ผΞϓϦͱͯ͠഑৴͢Δ • ΞϓϦʹΑͬͯ৭ʑͳ഑৴ઃఆ͕͋Δ • BETA: ࠷৽ͷmasterϒϥϯνͷ಺༰Λ഑৴͢Δ • TEST: ϦϦʔε௚લͷಈ࡞֬ೝ΍ࢼ࡞ஈ֊ͷػೳΛ

    ௥Ճ͠ػೳͷݕূ͢Δ • PR: PR୯ҐͰमਖ਼ɾػೳ௥Ճͷಈ࡞֬ೝΛߦ͏ • ಉ͡ΞϓϦ͸ҰՕॴ·ͱΊ͓͖͍ͯͨ • ઀ଓઌ2ͷมߋ͸ΞϓϦ಺ͷσόοάπʔϧͰมߋͰ͖ ΔΑ͏ʹ͍ͯ͠Δ 2 produc)onɺstagingɺ֤։ൃऀͷ։ൃ؀ڥͳͲ 9
  4. 12

  5. haneda ͷߏ੒ • AWS S3ʹϏϧυͨ͠όΠφϦͱϝλσʔλΛهड़ͨ͠JSONΛ഑ஔ͢Δ • CIͰϑΝΠϧੜ੒ͱΞοϓϩʔυΛߦ͏ͨΊͷfastlane ac4onΛ༻ҙͨ͠ • WebΞϓϦ

    • S3ͷJSONΛݩʹHTMLΛϨϯμϦϯά͢Δ • iOSΞϓϦμ΢ϯϩʔυ༻ͷmanifestΛಈతੜ੒͢Δ • DB͸࢖͍ͬͯͳ͍ • ೝূʹ͸ࣾ಺ڞ௨ͷϦόʔεϓϩΩγΛར༻͢Δ3 3 groupad(ࣾ಺ϒϩάɾWiki)ͳͲͷࣾ಺πʔϧͱڞ௨ͷΞΫηε੍ޚɻղઆهࣄ 13
  6. haneda ʹΑΓվળ͞Εͨ͜ͱ • G Suite ೝূʹͨ͠ͷͰೖࣾ࣌ʹࣾ಺ΞΧ΢ϯτ͕ൃߦ͞ΕΔͱಉ ࣌ʹར༻Մೳʹͳͬͨ4 • ଞͷࣾ಺πʔϧ܈ͱಉ͡ΞΧ΢ϯτɾΞΫηεݖݶͰར༻Մೳ ʹɺࣾ಺֎໰Θ༷ͣʑͳ৔ॴͰશࣾһ͕ར༻Ͱ͖Δ

    • લड़ͷΑ͏ͳγϯϓϧͳߏ੒ͷͨΊ഑৴αʔϏεࣗମͷ؅ཧෛ୲ ΋ͦ͜·Ͱ্͕ΒͣʹࡁΜͩ 4 DeployGate ͕ G Suite ࿈ܞʹରԠͨ͠ࡍʹܧଓར༻΋ݕ౼͕ͨ͠ɺҰ෦ػೳ͕଍Βͣݟૹͬͨ 14
  7. in-house fastlane ϓϥάΠϯ • in-house fastlane ϓϥάΠϯ5Λ࡞Γࣾ಺഑৴Λ৽نΞϓϦ։ൃʹಋ ೖ͠΍͍͢؀ڥʹͨ͠ • haneda

    ͷ S3 όέοτ໊ͳͲͷઃఆ஋͸ϓϥάΠϯʹؚΊɺ࠷௿ ݶͷઃఆ͚ͩͰΞοϓϩʔυͰ͖ΔΑ͏ʹ • Beta ͳͲͷΑ͘࢖͏όοδΛ͚ͭͨΓɺάϨΠεέʔϧʹ͢Δͳ ͲΞΠίϯΛՃ޻͢Δ ac5on ΋෇ଐ͢Δ 5 ࣾ಺ Gem Server Ͱ؅ཧɺfastlane ʹ֎෦ Gem Server ͔ΒϓϥάΠϯΛಋೖͰ͖Δ࢓૊ΈΛ௥Ճͨ͠ 15
  8. ϓϥάΠϯͷΞΫγϣϯ܈ • upload_mobile_app_to_s3 / haneda • pre5y_badge • save_adhoc_archive •

    Cer;ficates / Profiles • generate_provisioning_profile • generate_apns_cer;ficate • GitHub API wrappers • create_issue • add_labels • add_comment • has_label 16
  9. fastlane match ʹΑΔূ໌ॻɾ伴؅ཧ • ূ໌ॻɺൿີ伴ɺProvisioning Profile ͳͲΛ҉߸Խͯ͠ϦϙδτϦͰ؅ཧ͠ ͍ͯΔ6 • ΞϓϦͷ਺ɾkind

    ͕૿͑ͯ΋Ұݩ؅ཧͰ͖Δ • EnterpriseProgramͷݖݶ͕ڧ͍ূ໌ॻͳͲΛΈͩΓʹ։ൃऀʹ౉ͨ͘͠ͳ ͍ɺCIϚγϯͷΈΞΫηεͰ͖Ε͹Α͍ • CIϚγϯ͕ෳ਺͋ͬͯ΋Πϯετʔϧͷख͕ؒ૿͑ͳ͍ 6 iOSΞϓϦͷαϒϛοτࣗಈԽͱূ໌ॻ؅ཧͷޮ཰Խ - ΫοΫύου։ൃऀϒϩά 17
  10. ΞϓϦ഑৴ͷͨΊͷ lane ఆٛྫ lane :build_and_upload_to_haneda do app_identifier = base_app_identifier +

    '-beta' match(app_identifier: app_identifier, type: "enterprise", git_branch: "enterprise", readonly: true) pretty_badge(kind: 'beta', grayscale: false) gym(...) haneda( app_id: base_app_identifier, app_name: 'Overcookpad', kind_id: 'beta' ) end 18
  11. ಛఆͷϥϕϧ͕͍ͭͨPRͷΈ഑৴ॲཧΛߦ͏ lane :pull_request do |params| pr_number = params[:pr]&.to_i UI.user_error!('Pull request

    number required') unless pr_number # (Ϣχοτςετ/֤छ෼ੳͳͲ...) next unless has_label(id: pr_number, label: 'InHouseBuild') build_and_upload_to_s3(staging: true, build_kind: :pr) build_url = Actions.lane_context[SharedValues::UPLOADED_MOBILE_APP_BUILD_URL] add_comment(id: pr_number, body: "Build uploaded to #{build_url}") end 19