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

Expoで本番運用をしてみよう

Yu Watanabe
September 13, 2018

 Expoで本番運用をしてみよう

Expoで本番運用をするときに必要なことをまとめてみました

Yu Watanabe

September 13, 2018
Tweet

More Decks by Yu Watanabe

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ(1) Θͨͳ΂Ώ͏ ▸ ॴଐ ▸ גࣜձࣾg&h ▸ Web / ΞϓϦΛझຯͰެ։

    ▸ ࢓ࣄ಺༰ ▸ αʔό / ϑϩϯτ / ΞϓϦ / Web ▸ ΞΧ΢ϯτ ▸ Twitter : @hmktsu ▸ Github : @watanabeyu
  2. ࣗݾ঺հ(2) ▸ https://www.gandh.jp ▸ 3໊(ΤϯδχΞ͸ࣗ෼Ұਓ)Ͱฏۉ೥ྸߴΊͷγχΞձࣾ ▸ ΤϯλϝܥʹಛԽͨ͠αʔϏεΛओʹӡӦ ▸ WeddyWeddy(ݱࡏ࢓ࠐதͰ10݄ϦϦʔε༧ఆ) ▸

    μϯαʔ޲͚ಈըϓϥοτϑΥʔϜ ▸ Spotful(ൢച୅ཧళ) ▸ ΧφμൃΠϯλϥΫςΟϒಈըαʔϏε ▸ getstage(΄΅Ϋϩʔζ) ▸ ϛϡʔδγϟϯ/μϯαʔ/DJʹಛԽͨ͠ΦϯϥΠϯϚονϯάαʔϏε ▸ Partee(Ϋϩʔζ) ▸ ࣸਅ΍σβΠϯΛΦϦδφϧάοζͱͯ͠࡞੒Ͱ͖ΔΞϓϦ ݱࡏ͸WeddyWeddyΛϝΠϯʹνΣέϥονϣத
  3. ▸ Expoʹର͢Δෆ҆ͷ੠ ▸ JSͷΈ͔͠৮Εͳ͍ͷͰ։ൃͰ͖ͳ͍ػೳ͕͋Δ ▸ react-native linkͰ͖ͳ͍͔Β֎෦ͷSDK࢖͑ͳ͍ ▸ react-nativeຊମͷΞοϓσʔτʹ͙͢ʹରԠͰ͖ͳ͍ ▸

    detach͢Δͷ͕ҋਂ͍ͱ͍͏੠͔͠ฉ͍ͨ͜ͱͳ͍ ▸ ຊ൪Ͱ࢖͍ͬͯΔਓ͍Δͷʁ EXPO࢖ͬͯ·͔͢ʁ(2) Ҏલʹൃදͨ͠಺༰͕͋ΔͷͰͦͪΒΛࢀߟʹͲ͏ͧ ػೳຖʹϥΠϒϥϦͳͲͷ঺հΛ͍ͯ͠·͢ https://speakerdeck.com/watanabeyu/shi-li-dejian-ruexpopurodakusiyonapuri (גࣜձࣾFACTBASE͞ΜͰͷษڧձʹͯൃද) ຊ౰ʹຊ൪Ͱެ։Ͱ͖ΔΑ͏ͳΞϓϦ࡞ͬͨͷʁ
  4. ▸ ຊ൪ӡ༻Λ͢Δʹ͋ͨͬͯ։ൃͱॾʑͷઃఆ͕ҧ͏ ▸ APIͷΤϯυϙΠϯτ ▸ firebaseͷΩʔ৘ใ ▸ ͳͲͳͲ… ։ൃ؀ڥͱຊ൪؀ڥͷ෼͚ํ(1) ▸

    react-native-configΛ࢖͏ ▸ .envϑΝΠϧΛ࡞੒ͯ͠Ϗϧυ࣌ʹࢦఆͯ͠੾ସ ▸ $ ENVFILE=.env.staging react-native run-ios ௨ৗͷReact Native։ൃͰ͸Ͳ͏͢Δͷ͔ʁ
  5. ▸ 1. release-channelΛ࢖͏ ▸ publish / build͢Δࡍʹ--release-channel <environment>Ͱ੾ସ ▸ Constants.manifest.releaseChannel

    === “environment”Ͱ൑ผ ։ൃ؀ڥͱຊ൪؀ڥͷ෼͚ํ(2) Expo؀ڥԼͰ͸Ͳ͏ͨ͠ΒΑ͍ͷ͔ʁ EXPO.HOST exp publish —release-channel development development exp publish —release-channel production production
  6. ▸ 2. app.jsonΛγϯϘϦοΫϦϯΫͰ੾ସ ▸ app.development.json / app.production.jsonΛ࡞੒ ▸ publish /

    build͢ΔࡍʹγϯϘϦοΫϦϯΫͰ੾ସ ▸ $ ln -fs app.development.json app.json && expo build:ios ▸ Constans.manifest.extra.hogeͱͯ͠औΓग़͠ ։ൃ؀ڥͱຊ൪؀ڥͷ෼͚ํ(3) Expo؀ڥԼͰ͸Ͳ͏ͨ͠ΒΑ͍ͷ͔ʁ APP.DEVELOPMENT.JSON APP.JSON APP.PRODUCTION.JSON ln -fs app.development.json app.json ln -fs app.production.json app.json expo build:ios -release-channel <environment>
  7. ▸ άϩʔόϧʹΞϓϦΛग़͍ͨ͠ ▸ Permission֬ೝ࣌ͷΞϥʔτจݴΛมߋ͍ͨ͠ ▸ ϗʔϜը໘ͰͷΞϓϦද໊ࣔΛݴޠ͝ͱʹมߋ͍ͨ͠ ▸ จݴΛݴޠ͝ͱʹมߋ͍ͨ͠ ▸ ͳͲͳͲ…

    ଟݴޠରԠ(1) ▸ Xcode্ͰinfoPlistΛϩʔΧϥΠζͯ͠ઃఆ ▸ Android Studio্Ͱstrings.xmlΛϩʔΧϥΠζͯ͠ઃఆ ௨ৗͷReact Native։ൃͰ͸Ͳ͏͢Δͷ͔ʁ
  8. ▸ σϑΥϧτͰONʹͳ͍ͬͯΔͷͰઃఆෆཁ ▸ app.jsonͷupdatesͱ͍͏߲໨Λฤू͢Δ͜ͱͰOFFʹͰ͖Δ ▸ publish͢Δ͜ͱͰελϯυΞϩʔϯΞϓϦ͕Ξοϓσʔτ͞ΕΔ CODEPUSHతͳػೳͷ࢖͍ํ(2) Expo؀ڥԼͰ͸Ͳ͏ͨ͠ΒΑ͍ͷ͔ʁ EXPO.HOST exp

    publish —release-channel development exp publish —release-channel production development͕ߋ৽͞ΕΔ production͕ߋ৽͞ΕΔ ࠷ॳʹελϯυΞϩʔϯΞϓϦΛϏϧυͯ͠ ࣗ෼ͨͪʹ഑෍͓ͯ͘͠ͱ࣮ػ֬ೝ͕؆୯ʹ
  9. ·ͱΊ ▸ ؀ڥͷ੾ସ ▸ -release-channelΛ࢖͏ ▸ app.jsonΛγϯϘϦοΫϦϯΫͰ੾Γସ͑ ▸ ଟݴޠରԠ ▸

    γεςϜ෦෼͸app.jsonͷlocalesΛ࢖༻ ▸ ΞϓϦ಺จݴ͸ex-react-native-i18nΛ࢖༻ ▸ ΤϥʔτϥοΩϯά ▸ JS෦෼ͷΈߦ͑͹Α͘sentryͷτϥοΩϯάίʔυΛsentry-expoͰຒΊࠐΉ ▸ CodePushతͳػೳ͸σϑΥϧτͰON ▸ ࠷ॳʹελϯυΞϩʔϯΞϓϦΛ഑෍ ▸ exp publishͰਵ࣌൓өͤ͞Δͱ࣮ػ֬ೝ͕؆୯ʹ