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

ゆめみの iOS プロジェクトが
取り入れてる自動化の試み / What YUMEMI did...

Elvis Shi
August 20, 2020

ゆめみの iOS プロジェクトが
取り入れてる自動化の試み / What YUMEMI did to try to automate the process of iOS project development

Elvis Shi

August 20, 2020
Tweet

More Decks by Elvis Shi

Other Decks in Programming

Transcript

  1. } var employedBy = "YUMEMI Inc." var job = "iOS

    Tech Lead" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ ࣗ୐ʹ௕ډ͗ͯ͢͠ମ͕ͩΔ͍… """ final class Me: Developable, Talkable {
  2. CPPUTUSBQTIʢʣ install_prebuild_libraries() { # Gem BundleɺHomebrew ͱ Mint ΛඞཁʹԠͯ͡Πϯετʔϧ echo

    "Install Gems, Brews and Mints" if [ -e Gemfile ]; then bundle install fi if [ -e Brewfile ]; then brew bundle fi if [ -e Mintfile ]; then mint bootstrap fi }
  3. CPPUTUSBQTIʢʣ install_embeded_libraries() { # ඞཁʹԠͯ͡ CocoaPodsɺCarthage ͱ SwiftPM ͷϥΠϒϥϦʔΛಋೖ echo

    "Install dependencies via CocoaPods, Carthage and SwiftPM" if [ -e Podfile ]; then bundle exec pod install --repo-update fi if [ -e Cartfile ]; then carthage bootstrap --use-ssh --no-use-binaries --cache- builds --platform ios fi if [ $(find . -maxdepth 4 -name swiftpm | wc -l) -gt 0 ]; then workspace_file="$(ls | grep '.*\.xcworkspace$')" scheme="$(xcodebuild -workspace $workspace_file -list | sed -n -e '/Schemes:/,$p' | sed -n -e 2p | xargs echo)" xcodebuild -resolvePackageDependencies -workspace "$workspace_file" -scheme "$scheme" fi }
  4. 16--@3&26&45@5&.1-"5&NEʢʣ ## ֓ཁ <!-- Օ৚ॻ͖Ͱྑ͍ͷͰɺ؆ૉʹهࡌΛ͓ئ͍க͠·͢ɻ --> ## ϨϏϡʔ؍఺ <!-- ϨϏϡʔΞʹ֬ೝͯ͠΄͍͠ࣄฑͷهࡌΛ͓ئ͍க͠·͢ɻ

    ಛʹɺຊPRʹͯϨϏϡʔର৅֎ͷ಺༰͕͋Ε͹߹ΘͤͯهࡌΛ͓ئ͍க͠·͢ɻ (ྫ) Ϗϧυ͕௨Δঢ়ଶͱͳ͍ͬͯΔ͔ warnings ͕ग़ྗ͞Εͳ͍͜ͱ σβΠϯ͚ͩ૊ΈࠐΜͩͷͰɺ࢓༷ʹ͍ͭͯ͸ϨϏϡʔର৅֎ͱͯ͠ཉ͍͠ ͜ͷίϛοτ xxxxxxxxx(commit hash) ΛओʹϨϏϡʔͯ͠ཉ͍͠ --> ## ϨϏϡʔϨϕϧ <!-- ͲΕ͔ͷଧͪফ͠ઢΛ֎͍ͯͩ͘͠͞ɻ --> - ~~Lv0: ·ͬͨ͘ݟͳ͍ͰAccept͢Δ~~ - ~~Lv1: ͺͬͱΈͯҧ࿨ײ͕ͳ͍͔νΣοΫͯ͠Accept͢Δ~~ - ~~Lv2: ࢓༷Ϩϕϧ·Ͱཧղͯ͠ɺ࢓༷௨Γʹಈ͔͋͘Δఔ౓ݕূͯ͠Accept͢Δ~~ - ~~Lv3: ࣮ࡍʹ؀ڥͰಈ࡞֬ೝͨ͠͏͑ͰAccept͢Δ~~
  5. 16--@3&26&45@5&.1-"5&NEʢʣ ## εΫϦʔϯγϣοτ <!-- ը໘දࣔʹมԽ͕͋Δ৔߹ɺఴ෇΍ࢀরϦϯΫٴͼมԽ಺༰ͷهࡌΛ͓ئ͍க͠·͢ɻ ಛʹɺಈ࡞΍ΞχϝʔγϣϯͳͲ΋ϨϏϡʔͯ͠ཉ͍͠৔߹͸ɺಈ࡞֬ೝखॱΛॻ͍ͨΓɺεΫϦʔϯγϣοτͷఴ෇Λ͓ئ͍க͠· ͢ɻ (ྫ) ݟͨ໨ʹؔ͢Δมߋ͕ͳ͍ͨΊলུ͠·͢ɻ ܾఆϘλϯΛλοϓ࣌ʹɺදࣔมԽ͕͋Γ·͢ɻಈըఴ෇க͠·͢ɻ

    ※ಈըΛఴ෇͢Δͱ͖͸ɺGitHubͷ੍ݶͷͨΊɺΞχϝʔγϣϯGifʹม׵͍ͯͩ͘͠͞ɻ γϛϡϨʔλʔͰ࿥ը͢Δͱ͖ͷίϚϯυɿ `$ xcrun simctl io booted recordVideo screen.mov` ࿥ը͞ΕͨಈըΛGifʹม׵͢Δͱ͖ͷίϚϯυɿ `$ ffmpeg -i screen.mov -vf scale=320:-1 -r 10 screen.gif` ΋͠ffmpeg͕Πϯετʔϧ͞Ε͍ͯͳ͍৔߹ɺHomebrwe͔Β؆୯ʹΠϯετʔϧͰ͖·͢ɻ --> | before | after | |--------|-------| | XXXXXX | XXXXX | ## උߟ <!-- ଞʹ఻͓͖͍͑ͯͨ͜ͱ͕͋Ε͹هࡌΛ͓ئ͍͍ͨ͠·͢ɻ -->
  6. #JUSJTFʢσϓϩΠӡ༻ํ਑ʣ w #JUSJTFʹϏϧυ൪߸ͷมߋΛ೚ͤΔ w EFWFMPQϒϥϯν΁ͷ13͕͋ͬͨΒɿ w ։ൃऀ޲͚ʹ%FW؀ڥΛ#JUSJTFʹσϓϩΠ w EFWFMPQϒϥϯν͕.FSHF͞ΕͨΒɿ w

    ΫϥΠΞϯτ޲͚ʹ4UH؀ڥΛ#JUSJTFʹσϓϩΠ w NBTUFSϒϥϯν͕.FSHF͞ΕͨΒɿ w Ϣʔβ޲͚ʹຊ൪؀ڥΛ"QQ4UPSFʹσϓϩΠ w σϓϩΠ݁ՌΛ4MBDLʹ23ίʔυ෇͖Ͱ௨஌ ɿ13ͷ৔߹͸ɺ13ͷϖʔδʹ΋σϓϩΠ݁ՌΛ23ίʔυ෇͖ͰίϝϯτΛೖΕΔ
  7. SFMFBTF@DPEFTJHOTIʢʣ bootstrap() { fastlane match $development_release_action -a $development_bundle_id -b $development_team_id

    --git_branch $development_team_id --readonly fastlane match $staging_release_action -a $staging_bundle_id -b $staging_team_id --git_branch $staging_team_id --readonly fastlane match $production_release_action -a $production_bundle_id -b $production_team_id --git_branch $production_team_id --readonly } update() { echo "Please enter your Apple Developer Account ID to update the certificates:" read developer_id fastlane match $development_release_action -a $development_bundle_id -b $development_team_id -u $developer_id --git_branch $development_team_id fastlane match $staging_release_action -a $staging_bundle_id -b $staging_team_id -u $developer_id --git_branch $staging_team_id fastlane match $production_release_action -a $production_bundle_id -b $production_team_id -u $developer_id --git_branch $production_team_id } ౰વͳ͕ΒɺGBTUMBOFNBUDIΛར༻͍ͯ͠ΔͨΊɺূ໌ॻΛอ؅͢ΔHJUϦϙͷ63-ͳͲͷҰ෦ઃఆʹ.BUDIpMF΋ඞཁ
  8. SFMFBTF@DPEFTJHOTIʢʣ while getopts :-: OPT; do case $OPT in "-"

    ) case $OPTARG in "update" ) SHOULD_UPDATE="TRUE" ;; esac ;; esac done if ! type fastlane &> /dev/null; then echo "Fastlane is not installed. Please install Fastlane first" exit 1 fi if [ "$SHOULD_UPDATE" = "TRUE" ]; then update else bootstrap fi
  9. ࢀߟࢿྉ w IUUQTTIFMMTDSJQUTVOPOFNFUVUPSJBMIUNM w IUUQTRJJUBDPNLBUTVLJJJUFNTCGFFBFF w IUUQTEPDTHJUIVCDPNKBHJUIVCCVJMEJOHBTUSPOHDPNNVOJUZ DPOpHVSJOHJTTVFUFNQMBUFTGPSZPVSSFQPTJUPSZ w IUUQTEFWDFOUFSCJUSJTFJP

    w IUUQTRJJUBDPNMPWFFJUFNTFBFGC w IUUQTEBOHFSTZTUFNTTXJGU w IUUQTRJJUBDPNMPWFFJUFNTBEBFC w IUUQTTQFBLFSEFDLDPNMPWFFQBUIUPJNQPSUEBOHFSTXJGU