GitLab-CI에서 iOS 앱 테스트 및 빌드하기

2019. 11. 18. 12:15서버 프로그래밍

GitLab에서 Node.js 백앤드, VueJS 프론트앤드, 안드로이드 프로젝트 등 여러 플랫폼에 대한 파이프라인을 적용하여 테스트해보았다. 이들은 Docker를 이용하여 GitLab Runner가 서버상에서 자동으로 테스트와 빌드를 수행할 수 있는데, iOS의 경우는 익히 우리가 알고 있는 것처럼 MacOS를 가상화하거나 Docker 형태로 사용할 수 있는 방법이 없다보니 약간 다른 방법으로 설정해서 사용해야 한다.

일단, AWE EC2 상에 GitLab Runner를 설치하고 등록해서 사용했던 다른 프로젝트들과 달리, MacOS용 Gitlab Runner를 개발자의 맥북프로에 설치를 하고, AWS EC2 상에 설치되어 운용되는 Gitlab 서버와 연동하는 방식이다. 처음에는 개념이 다소 이해되지 않았는데, 소스를 수정하고 Commit & push를 하면 Gitlab에서 나의 맥북프로에서 실행 중인 Gitlab runner를 호출하고, 시뮬레이터를 자동으로 실행하면서 유닛 테스트를 수행하는 모습은 상당히 인상적이다.

https://about.gitlab.com/blog/2019/03/06/ios-publishing-with-gitlab-and-fastlane/

 

How to publish iOS apps to the App Store with GitLab and fastlane

See how GitLab, together with fastlane, can build, sign, and publish apps for iOS to the App Store.

about.gitlab.com

이번에 처음으로 Fastlane을 알게 되었는데, 기대한 것처럼 로컬이 아닌 서버 상에서의 테스트 및 빌드, 배포가 아닌 것은 아쉽지만 로컬에서라도 자동화가 가능하다는 것은 큰 도움이 된다. 특히나 다수의 아이폰 앱을 수시로 배포하고 관리해본 경험이 있는 입장에서는 이것만으로도 충분히 유용하다는 것은 체감할 수 있다.

https://sesang06.tistory.com/124

 

Fastlane 으로 iOS 빌드 과정을 손쉽게 자동화하자

Fastlane 으로 iOS 빌드하기 https://fastlane.tools/ fastlane은 루비 기반 클라이언트 자동 빌드 오픈소스 라이브러리입니다. iOS 프로젝트에서는 코드 사이닝 관리, 스크린샷, 테스트플라이트 업로드, 앱스토어..

sesang06.tistory.com

중복이 되기는 하지만, Gitlab에 iOS 프로젝트를 적용하는 예제 사이트들은 다음과 같다.

https://medium.com/@phanquanghoang/using-gitlab-ci-cd-fastlane-for-ios-project-part-1-5e7db82a3566

 

Using Gitlab CI/CD + Fastlane for iOS Project — Part 1

In this tutorial, I will introduce to you how to setup CI/CD on GitLab for iOS project. Through this article, you will approach some…

medium.com

https://medium.com/flawless-app-stories/how-to-set-up-gitlab-continuous-integration-for-ios-projects-without-a-hustle-53c2b642c90f

 

How to set up GitLab Continuous Integration for iOS projects without a hustle

In this beginner guide, I’ll share my step-by-step process to configure GitLab-CI/CD & Fastlane with ease.

medium.com

 

다만, 늘 그러하듯이 Fastlane에 iOS 앱 개발용 인증서를 적용하는 부분은 역시나 짜증을 유발한다.

https://docs.fastlane.tools/codesigning/xcode-project/

 

Xcode Project - fastlane docs

New to fastlane? Click here to open the installation & setup instructions first xcode-select --install # Using RubyGems sudo gem install fastlane -NV # Alternatively using Homebrew brew cask install fastlane fastlane init More Details Setting up your Xcode

docs.fastlane.tools

https://docs.fastlane.tools/actions/cert/

 

cert - fastlane docs

cert Alias for the get_certificates acti

docs.fastlane.tools

https://docs.fastlane.tools/actions/sigh/

 

sigh - fastlane docs

sigh Alias for the get_provisioning_prof

docs.fastlane.tools

https://codesigning.guide/

 

Code Signing Guide for Teams

A new approach to code signing A best practices guide on how to manage certificates and provisioning profiles in your development team. Wait, what is code signing? Code signing is required on iOS when distributing your app to customers. It assures that you

codesigning.guide

 

아래 예제는 2016년 한참전 버전 기준의 문서라 그저 참고용으로만 링크한다.

https://about.gitlab.com/blog/2016/03/10/setting-up-gitlab-ci-for-ios-projects/

 

Setting up GitLab CI for iOS projects

Learn how to set up GitLab CI for your iOS projects.

about.gitlab.com