Skip to content

Conversation

@thingineeer
Copy link
Collaborator

@thingineeer thingineeer commented Jan 19, 2024

🌱 작업한 내용

  • fastlane을 도입했습니다
  • 이제 fastlane match를 통해 쉽게 인증서 관리가 가능합니다.
  • 저번처럼 카톡으로 제가 인증서를 드리지 않아도 본인이 직접 터미널에 명령어를 입력하면 Github private 레포지토리에 제가 올려둔 인증서들이 자동으로 다운로드 되는 원리입니다.

🌱 PR Point

  • fastlane은 CI/CD 툴입니다. 참고
  • lane 명령어를 생성하고 fastlane에서 제공하는 함수들을 활용하여 원하는 기능을 구현할 수 있습니다.

생성한 lane

  • 인증서를 다운받는 match_read_only
  • 프로젝트 버전을 설정하는 set_version
  • 테스트플라이트 업로드를 해주는 beta (Slack 연동)
    • slack 주소는 보안적인 부분이라 git reset HEAD^로 커밋 되돌린 다음
      Force-Push 하고 푸시 한 커밋 기록 삭제 후 새 커밋으로 등록됩니다.

이렇게 3가지를 만들어 두었으며 필요하다면 추가적으로 만들어서 사용하시면 됩니다!!
지금은 인증서를 최신화하는 match_read_only만 사용해도 무관합니다.

머지 후 각자 해야 할 일

우선 Github ssh 등록은 안했다면 등록 해주세요 가이드

Fastlane 공식 가이드 참고

  1. 터미널 켜서 Runnect 프로젝트 폴더로 이동
  2. xcode-select --install 실행
  3. fastlane 설치 -> 공식 문서에서는 Bundler를 사용해 설치하는 것을 권장하는데 이렇게 하니까 fastlane 명령어를 실행할 때 앞에 bundle exec를 붙여야 해서 저는 brew로 설치했습니다. 각자 편한 방식으로 하면 될 것 같아요! brew install fastlane
  4. fastlane 폴더가 있을텐데 거기로 이동해서 .env.default 파일 생성하고 제가 따로 전달할 코드들을 이 파일에 붙여넣기
    4-1. FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD 은 개인 App_ID
  5. 터미널에서 프로젝트 파일이 있는 경로로 이동
  6. fastlane match_read_only실행 -> 이렇게 하면 자동으로 깃헙에 올라가 있는 인증서들 다운로드 진행
  7. 만약 passphrase를 입력하라고 하면 카톡으로 전달한 비번 입력
  8. 키체인 password 입력하라고 하면 각자 노트북 비번 입력
  9. 여기까지 성공 했으면 Xcode로 프로젝트 켜서, provisioning 인증서가 match 어쩌고~~로 잘 들어가 있는지 확인!!!!

여기까지 하면 세팅 + 실행 확인까지 잘 된거에요!

하다가 잘 안되는 부분 있으면 언제든 연락 주시면 됩니다!

추가적인 lane 사용법

앞서 3가지 lane을 생성했다고 했는데 이것들은 Fastfile에 들어가면 Ruby라는 언어로 작성되어 있습니다.
만들어둔 3가지 lane에 대한 설명을 첨부합니다. (터미널에 아래와 같이 입력하면 실행됩니다!)

  • fastlane set_version version:2.1.5: 이렇게 하면 우리 프로젝트 버전이 2.1.5로 자동 변경됩니다.
  • fastlane beta version:2.1.5: 2.1.5로 버전 설정후 테스트플라이트 자동 업로드 (인증서도 최신화 자동으로 합니다.)
  • fastlane match_read_only: 인증서 최신화

📮 관련 이슈

@thingineeer thingineeer added Feat 새로운 기능 구현 Setting 프로젝트 세팅, 라이브러리 설치 명진😼 labels Jan 19, 2024
@thingineeer thingineeer requested a review from 513sojin January 19, 2024 13:36
@thingineeer thingineeer self-assigned this Jan 19, 2024
@thingineeer thingineeer changed the title [Setting] #248 - fastlane 변경 작업 [Setting] #248 - fastlane match 추가 Jan 21, 2024
@gitguardian
Copy link

gitguardian bot commented Jan 22, 2024

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@thingineeer thingineeer changed the title [Setting] #248 - fastlane match 추가 [Setting] #248 - fastlane match, TestFlight 도입 하였습니다. Jan 23, 2024
Comment on lines +67 to +73
slack(
username: "이명진",
message: "TestFlight 배포 성공.",
icon_url: "https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/a6/68/d0/a668d049-8c1a-0e7b-19c3-287093c0a501/AppIcon-1x_U007emarketing-0-7-0-85-220.png/1024x1024bb.png",
slack_url: ENV["RUNNECT_SLACK"],
payload: { "Version": version }
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테플 lane에 Slack 추가
slack_url 은 숨겨서 안 쓴다면 git 요정과, 슬랙 본사한테 연락 옵니다.
강제 푸시 해서 없애주지 않으면 그 url은 강제로 삭제가 됩니다.
전 url도 삭제되고, 강제 푸시도 해서 깃 히스토리를 지웠음

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git 요정이라니 새롭네요 ㅋㅋㅋㅋㅋ 확인했습니다 ~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깃 요정 이래 깃 가디언...

Copy link
Collaborator

@513sojin 513sojin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다 ~ !!

새로운 팀원이 왔을 때 저번처럼 카톡으로 제가 인증서를 드리지 않아도 본인이 직접 터미널에 명령어를 입력하면 Github private 레포지토리에 제가 올려둔 인증서들이 자동으로 다운로드 되는 원리입니다.

이건 정말 눈물나네요 ... 그런 번거로운 과정을 없애주셔서 감사합니다 명진 최고 ,, 🥹

Comment on lines +395 to +397
func mapView(_ mapView: NMFMapView, cameraWillChangeByReason reason: Int, animated: Bool) {
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 코드는 뭔가용 ?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분이 지도를 움직일 때 사용되는 메서드인데, 하나 구현하면 하나가 안되는 이ㅅ가 있어서 일단 내용은 빼고, 빈 메서드만 추가 해놨어요!

Comment on lines +67 to +73
slack(
username: "이명진",
message: "TestFlight 배포 성공.",
icon_url: "https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/a6/68/d0/a668d049-8c1a-0e7b-19c3-287093c0a501/AppIcon-1x_U007emarketing-0-7-0-85-220.png/1024x1024bb.png",
slack_url: ENV["RUNNECT_SLACK"],
payload: { "Version": version }
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git 요정이라니 새롭네요 ㅋㅋㅋㅋㅋ 확인했습니다 ~

Comment on lines +86 to +96
############# Device Management #############

desc "Register Devices"
lane :register_new_device do |options|
device_name = prompt(text: "Enter the device name: ")
device_udid = prompt(text: "Enter the device UDID: ")
device_hash = {}
device_hash[device_name] = device_udid
register_devices(devices: device_hash)
match(type: "development", force_for_new_devices: true)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거는 어떤 코드인가요 ?! device 등록하는 것두 fastlane에서 관리해주는 건쥐 궁금합니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device 이름과 번호도 command로 간단하게 입력해 주면 자동으로 등록되는 거예요!

@thingineeer thingineeer merged commit bf46e56 into Runnect:develop Jan 26, 2024
@thingineeer thingineeer deleted the #248---fastlane branch January 26, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat 새로운 기능 구현 Setting 프로젝트 세팅, 라이브러리 설치 명진😼

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Setting] #248 - fastlane

2 participants