Bitriseことはじめ

Dcebc7211303cb2ad89d7b011af920a1?s=47 Marina Nakagawa
January 29, 2018
2.1k

 Bitriseことはじめ

Dcebc7211303cb2ad89d7b011af920a1?s=128

Marina Nakagawa

January 29, 2018
Tweet

Transcript

  1. 1 Bitrise͜ͱ͸͡Ί ೔ຊܦࡁ৽ฉࣾɹத઒ ສᣦಸ Otemachi.swiftɹ×ɹKyobashi.swift #02

  2. 2 Marina Nakagawa @marina10172013 ೔ຊܦࡁ৽ฉࣾͷiOSΤϯδχΞ ిࢠ൛ΞϓϦɼࢴ໘ϏϡʔΞʔΞϓϦͷ։ൃ

  3. 3 ຊ೔࿩͢͜ͱ Bitriseͱ͸ ฐࣾͷCIαΠΫϧ Bitrise࣮ફνϡʔτϦΞϧ 1 2 3 BitriseTips 4

  4. 4 Bitriseͱ͸ 1

  5. 5 Bitriseͱ͸ ϞόΠϧΞϓϦ։ൃʢiOS Android,Xamarin…ʣ Λओ؟ʹ͓͍ͨCI/CDαʔϏεϓϥοτϑΥʔϜ

  6. 6 Ͳ͏ͯ͠ಋೖͨ͠ͷʁ

  7. 7 Travis CIͷXcode࣍ظόʔδϣϯରԠ͕஗ͯ͘ίέΔɹɹ ཧ༝̍ BitriseͷXcodeͷόʔδϣϯରԠ͕ ૣͯ͘Αͦ͞͏ɹɹɹɹɹɹɹɹɹɹɹ

  8. 8 !ূ໌ॻΛϓϩϏδϣχϯάϑΝΠϧΛCI༻ʹ༻ҙͨ͠Γ !ॺ໊༻ͷൿີ伴ͷ؅ཧํ๏ ূ໌ॻ͕೉͍͠ ཧ༝̎ ূ໌ॻपΓ΍ൿີ伴पΓָ͕

  9. 9 TravisCI ಉ࣮࣌ߦ਺̎ 129υϧ ίετ໘ ཧ༝̏ TravisCI ಉ࣮࣌ߦ਺3 150υϧ ಉ࣮࣌ߦ਺ʹ͔͔ΔίετͰൺֱ͢Δͱˈ14.5͍҆

  10. 10

  11. 11 ಉ࣌ʹ̏ͭճͤΔϓϥϯͰܖ໿

  12. 12 ϥΠϒϥϦߋ৽Λ๨Εͯख໭Γ͢Δ S3 ϏϧυࡁΈͷϥΠϒϥϦ Ξοϓϩʔυ ϏϧυࡁΈͷϥΠϒϥϦ μ΢ϯϩʔυ ཧ༝̐

  13. 13 ϥΠϒϥϦߋ৽Λ๨Εͯख໭Γ͢Δ S3 ϏϧυࡁΈͷϥΠϒϥϦ Ξοϓϩʔυ ϏϧυࡁΈͷϥΠϒϥϦ μ΢ϯϩʔυ ཧ༝̐ த઒:QA͞Μʂ֬ೝ͓ئ͍͠·͢ʂ QA͞Μ:ϏϧυͰ͖ͳ͍Ͱ͢ɾɾɾ

    த઒:͋͋ͬɾɾ͍͢·ͤΜɾɾ֬ೝ͠·͢ த઒:ϥΠϒϥϦߋ৽͠๨Εͯ·ͨ͠ɾɾ ɹɹɹ΋͏Ұ౓֬ೝ͓ئ͍͍ͨ͠·͢
  14. 14 ϥΠϒϥϦߋ৽Λ๨Εͯख໭Γ͢Δ S3 ϏϧυࡁΈͷϥΠϒϥϦ Ξοϓϩʔυ ϏϧυࡁΈͷϥΠϒϥϦ μ΢ϯϩʔυ ཧ༝̐ ख໭Γͷ͕࣌ؒ΋͍ͬͨͳ͍

  15. 15 ΞʔΧΠϒʴiTunesConnect Ξοϓϩʔυʹ͕͔͔࣌ؒΔ ཧ༝̑

  16. 16 ΞʔΧΠϒʴiTunesConnect Ξοϓϩʔυʹ͕͔͔࣌ؒΔ ཧ༝̑ !20ʙ30෼ଞͷ࡞ۀ͕Ͱ͖ͳ͍ !Ϗϧυ൪߸Λؒҧ͑ͯ࠶ΞʔΧΠϒͨ͜͠ͱ΋ !ਃ੥΍ϦϦʔεΛͩ͢ϏϧυΛؒҧ͑Δϛε͕ൃੜͦ͠͏
 ʢओʹࢲ͕ʣ

  17. 17 ΞʔΧΠϒʴiTunesConnect Ξοϓϩʔυʹ͕͔͔࣌ؒΔ ཧ༝̑ ͭΒ͍

  18. 18 ࣗಈԽ͠·͠ΐ͏

  19. 19 ฐࣾͷCIαΠΫϧ 2

  20. 20 ΍Γ͍ͨ͜ͱ 1 !ϦϦʔε͢Δόʔδϣϯͷϒϥϯν͕Ϛʔδ͞Εͨ࣌ ɹࣗಈͰiTunesConnectʹΞοϓϩʔυ !TestFlight഑৴ !Ϗϧυ൪߸ΛࣗಈͰ্͛Δ

  21. 21 ճ͍ͨ͠αΠΫϧ ূ໌ॻ֬ೝ S3͔ΒϑϨʔϜϫʔΫΛμ΢ϯϩʔυ Ϗϧυ൪߸Λ্͛ΔͨΊͷ ϓϥάΠϯΛμ΢ϯϩʔυ Ϗϧυͯ͠iTunesConnectʹΞοϓϩʔυ ϏϧυφϯόʔΛ͋͛ͯgitʹpush ΩϟογϡΞοϓσʔτʴslack௨஌

  22. 22 ΍Γ͍ͨ͜ͱ !ϥΠϒϥϦ͕ߋ৽͞ΕͯΔ͔֬ೝ !ϏϧυࡁΈͷϑϨʔϜϫʔΫΛS3ʹ্͛Δ 2

  23. 23 ճ͍ͨ͠αΠΫϧ pushͨ͠ϒϥϯνΛμ΢ϯϩʔυ pushͨ͠ϒϥϯνΛμ΢ϯϩʔυ ϥΠϒϥϦͷߋ৽͕͋Δ͔Λ֬ೝ S3ʹϑϨʔϜϫʔΫΛΞοϓσʔτ slackʹ௨஌ S3

  24. 24 Bitrise࣮ફ ~BitriseͷΈͰσϓϩΠͯ͠Ϗϧυ൪߸Λ্͛Δ·Ͱ~ 3

  25. 25 ূ໌ॻΛग़ྗ͢Δ ࢀߟURL: http://devcenter.bitrise.io/ios/uploading-certificates/ ԼهίϚϯυΛ࣮ߦͯ͠ɺΞʔΧΠϒ͍ͨ͠εΩʔϚΛબ୒͢Δ bash -l -c "$(curl -sfL

    https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode.sh)" XcodeϑΝΠϧΛ Darg&Drop
  26. 26 ূ໌ॻΛग़ྗ͢Δ

  27. 27 ग़ྗ͞Εͨূ໌ॻΛΞοϓϩʔυ

  28. 28 Workflowsλϒ

  29. 29 ϫʔΫϑϩʔͷ໊લΛ͍ΕΔ

  30. 30 ϫʔΫϑϩʔΛͭ͘Δ

  31. 31 ϫʔΫϑϩʔΛͭ͘Δ ←͜͜·Ͱ͸σϑΥϧτͷ··ͰOK ←͔͜͜Βઃఆ͕ඞཁ

  32. 32 㲔 Ϗϧυ൪߸ΛࣗಈͰ্͛ΔͨΊͷઃఆ Info.plistͷϑΝΠϧύεΛೖྗˣ ͜͜ʹ਺ࣈΛೖΕ͓ͯ͘ͱ Info,plistʹొ࿥͞Ε͍ͯΔϏϧυ൪߸ʴBuild Number OffsetʹͳΓ·͢ˢ 㲔 σϑΥϧτͰ͸ɼBitriseͷϏϧυ൪߸͕

    ୅ೖ͞ΕΔઃఆʹͳ͍ͬͯ·͢ˠ
  33. 33 ΞʔΧΠϒͯ͠ग़ྗ͢Δઃఆ 㲔 ↑iTunes Connectʹఏग़͢ΔͨΊapp-storeΛબ୒͠·͢

  34. 34 iTunesConnectʹΞοϓϩʔυ͢Δઃఆ iTunes Connect: User Apple ID (email) iTunes Connect:

    Password iTunes Connect: App Apple ID iTunes Connect: App Bundle ID iTunes Connect: Team name ←͜ͷ߲໨Λೖྗ͢Δ
  35. 35 㲔 Slackͷಛఆͷνϟϯωϧʹ௨஌ΛૹΔ ↑Webhook URLΛऔಘͯ͠୅ೖ͢Δ

  36. 36 Webhook URLΛऔಘ͢Δ

  37. 37 ↑͜ΕΛbitriseʹίϐϖ

  38. 38 ׬ྃ

  39. 39 Tips 4

  40. 40 ؀ڥม਺Λઃఆ͍ͨ࣌͠ ϦϙδτϦ͝ͱʹ؀ڥม਺ΛઃఆͰ͖·͢ ϫʔΫϑϩʔ͝ͱʹ؀ڥม਺Λઃఆ͢Δ͜ͱ΋Մೳ

  41. 41 ϒϥϯν͝ͱʹϫʔΫϑϩʔΛม͍͑ͨ࣌ develop-*͸ͱʹ͔͘develop-ʹҰகͯ͠Ε͹deployϫʔΫϑϩʔ͕࣮ߦ͞Ε·͢ʢྫdevelop-2.7.3ʣ ্͔Βॱ൪ʹҰக͢Δϒϥϯν͕ݟ͔ͭͬͨΒྡͷϫʔΫϑϩʔ͕࣮ߦ͞Ε·͢ ͜ͷྫͩͱdevelop-* →ɹbeta-*ɹˠ;ͨͭʹҰக͠ͳ͍৔߹͸ϒϥϯνͷ໊લ͕ԿͰ͋ͬͯ΋ update_carhage_cahceϫʔΫϑϩʔ͕࣮ߦ͞Ε·͢

  42. 42 priveteͷϦϙδτϦΛ࢖͍͍ͨ࣌ bitriseɹsettingλϒ಺

  43. 43 githubɹbotΞΧ΢ϯτͷsettingϖʔδ ࡞੒ͨ͠Bot͕ϓϥΠϕʔτϦϙδτϦΛಡΊΔ͔Ͳ͏͔ͷઃఆΛ๨Εͣʹʂ

  44. 44 PodsͷΩϟογϡΛ্͍͛ͨ࣌ ࢀߟURL https://discuss.bitrise.io/t/how-to-cache-cocoapods-dependencies/193 Cache Pods Cache:Pull σϑΥϧτͷ··ͰOK ϫʔΫϑϩʔͷ࠷ॳͷํͰઃఆ͢Δඞཁ͕͋Δ
 (Git

    Clone Repositoryͷ࣍ʹઃఆ͠·ͨ͠ʣ Cache PathsΛॻ͖׵͑·ͨ͠ ϫʔΫϑϩʔͷҰ൪࠷ޙʹઃఆ͠·ͨ͠
  45. 45 fastlaneͰϏϧυ൪߸Λ͍͋͛ͤͨ࣌͞ desc "update build number" lane :update_build_number do |options|

    xcodeproj = XCODEPROJ_PATH build_number = options[:build_number] version_number = options[:version_number] # dist increment_build_number_in_plist(xcodeproj: xcodeproj, target: SCHEME_DIST, build_number: build_number) # dev increment_build_number_in_plist(xcodeproj: xcodeproj, target: SCHEME_DEV, build_number: build_number) end desc "Commit and push to remote" lane :commit_and_push do # git commit sh "git checkout #{git_branch}" git_add(path: [PLIST_PATH_DEV, PLIST_PATH_DIST]) git_commit(path: [PLIST_PATH_DEV, PLIST_PATH_DIST], message: "Increment Info-development.plist and Info.plist build number [skip ci] ") push_to_git_remote( remote: "origin", local_branch: "#{git_branch}", remote_branch: "#{git_branch}", force: false, # optional, default: false tags: false # optional, default: true ) end
  46. 46 ໰୊఺ ୭͔͕pushͨ͠ޙ͸pull͠ͳ͍ͱ Ϗϧυ൪߸͕͔ͿΔɾɾɾ Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ξοϓϩʔυ ͢ͰʹϏϧυ൪߸30ͷ

    σʔλ͕ଘࡏ͢ΔͨΊ
 ΞοϓϩʔυͰ͖ͳ͍
  47. 47 ໰୊఺ ୭͔͕pushͨ͠ޙ͸pull͠ͳ͍ͱ Ϗϧυ൪߸͕͔ͿΔɾɾɾ Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ϗϧυ൪߸30 Ξοϓϩʔυ ͢ͰʹϏϧυ൪߸30ͷ

    σʔλ͕ଘࡏ͢ΔͨΊ
 ΞοϓϩʔυͰ͖ͳ͍ BitriseͷϏϧυ൪߸ʹ߹Θͤͯ Ϗϧυ൪߸Λੜ੒͢Δํ਑ʹมߋ
  48. 48 ymlϑΝΠϧͷѻ͍ํ͕΄͔ͷCIͱҧ͏ bitriseCIͷymlϑΝΠϧΛมߋͯ͠ϦϙδτϦʹ͋͛ͯ΋ ͦΕ͕bitrise্ʹ൓ө͞ΕΔΘ͚Ͱ͸ͳ͍ bitriseͷWebαʔϏε্Ͱมߋ͢Δඞཁ͕͋Δ

  49. 49 ࢀߟURL: http://devcenter.bitrise.io/tips-and-tricks/use-bitrise-yml-from-repository/ bitriseͷ৴೦ !ϒϥϯνͷτϦΨʔ͸bitrise.io্Ͱ؅ཧ͢Δͷ͕ྑ͍ Bitrise͸ɺϒϥϯνͷ໊લΛτϦΨʔʹͯ͠ɺ ࣮ߦ͢ΔϫʔΫϑϩʔΛܾΊͯΔ͔Β !Ϗϧυߏ੒Λbitriseʹอଘ͢Δͱɺ ৽͍͠Ϗϧυߏ੒Ͱ͍ͭͰ΋؆୯ʹ࠶ߏஙͰ͖ͯศར

  50. 50 େମfastlaneͰઃఆ͔ͨ͠Β bitriseͷ৴೦ʹدΓఴ͑ͳ͔ͬͨɾɾɾɾ

  51. 51 ࠷ޙʹ

  52. 52 ࣗಈԽͯ͠޾ͤʹͳͬͨ ࢹ֮తͰॳ৺ऀʹ΍͍͞͠

  53. 53 ͋Γ͕ͱ͏͍͟͝·ͨ͠