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

iOS開発とGitLab CI

iOS開発とGitLab CI

2017/04/11 GitLab Meetup Tokyo #2 にてiOS開発におけるGitLab CIの活用方法について発表しました。

https://gitlab-jp.connpass.com/event/52276/

Kenta Enomoto

April 11, 2017
Tweet

More Decks by Kenta Enomoto

Other Decks in Programming

Transcript

  1. iOS։ൃݱ৔Ͱͷ໰୊ • ࠶ݱੑͷͳ͍खಈϏϧυ $ xcodebuild -scheme Foobar archive -archivePath Foobar

    -configuration "Debug" $ xcodebuild -exportArchive -exportOptionsPlist exportOptionsDev.plist - archivePath "Foobar.xcarchive" -exportPath "artifacts"
  2. GitLab CIͷಋೖํ๏ • Setting up GitLab CI for iOS projects


    https://about.gitlab.com/2016/03/10/ setting-up-gitlab-ci-for-ios-projects/
  3. ϏϧυϚγϯͷηοτΞοϓ • Mac
 - Xcode
 - iOS Certificates
 - Provisioning

    Profiles • GitLab Runner • ϏϧυϚγϯ͕ͳͯ͘΋OK
 -> ͻͱ·ͣ։ൃػΛϏϧυϚγϯͱ݉༻ʹ
  4. .gitlab-ci.yml GitLabCISandbox !"" .git !"" .gitignore !"" .gitlab-ci.yml !"" .swiftlint.yml

    !"" GitLabCISandbox !"" GitLabCISandbox.xcodeproj !"" GitLabCISandbox.xcworkspace !"" GitLabCISandboxTests !"" Podfile !"" Podfile.lock !"" Pods !"" README.md !"" exportOptionsAdHoc.plist !"" exportOptionsDev.plist #"" exportOptionsRelease.plist • ϓϩδΣΫτͷrootʹ.gitlab-ci.ymlΛ࡞੒

  5. .gitlab-ci.yml stages: - test - build .job_template: &job_definition before_script: -

    export LANG=en_US.UTF-8 - security unlock-keychain -p $PASS_PHRASE /Users/$USER_NAME/Library/Keychains/login.keychain - export DEVELOPER_DIR=/Applications/Xcode8.app/Contents/Developer <தུ> build_dev: <<: *job_definition stage: build script: - xcodebuild -scheme {scheme_name} archive -archivePath {your_path} -configuration "Debug" - xcodebuild -exportArchive -exportOptionsPlist exportOptionsDev.plist -archivePath “{yours}.xcarchive” -exportPath "artifacts/dev" artifacts: paths: - artifacts when: manual <ҎԼུ>
  6. .gitlab-ci.yml • only
 master, developͳͲಛఆͷϒϥϯνͷΈͰεΫϦϓτΛ࣮ߦ • when
 manualΛࢦఆ͢ΔͱɺGUIૢ࡞ΛܖػʹεΫϦϓτΛ࣮ߦ • cache


    ಛఆͷσΟϨΫτϦ഑ԼΛΩϟογϡ • tags
 ϏϧυϚγϯͷࢦఆʹ࢖༻
 https://docs.gitlab.com/ce/ci/yaml/
  7. ໰୊Λղܾ • git pushͷ౓ʹϏϧυ, lint, Ϣχοτςετ • git pushͷ౓ʹipaΛੜ੒ •

    masterϒϥϯν΁ͷϚʔδͷ౓ʹ
 ϦϦʔεϏϧυ • artifactsʹ͸URL͕෇༩͞ΕΔͨΊڞ༗ָ͕