๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐ŸŽ iOS/iOS

[iOS] fastlane์„ ์ด์šฉํ•ด ๋ฐฐํฌ ์ž๋™ํ™”ํ•˜๊ธฐ

์•ˆ๋…•ํ•˜์„ธ์š” ์ œ์ธ์ž…๋‹ˆ๋‹ค :)

์˜ค๋Š˜์€ ํ”„๋กœ์ ํŠธ์— fastlane์„ ๋„์ž…ํ•œ ๊ฒฝํ—˜์„ ํ•œ๋ฒˆ ๊ณต์œ ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!!

๋ฐฐํฌ ์ž๋™ํ™”๋ž€?

๋จผ์ €, ๋ฐฐํฌ ์ž๋™ํ™”๊ฐ€ ๋ฌด์—‡์ธ์ง€๋ถ€ํ„ฐ ์ •๋ฆฌํ•˜๊ณ  ๋„˜์–ด๊ฐ€๊ฒ ์Šต๋‹ˆ๋‹ค!

๊ฐœ๋ฐœ ๊ณต๋ถ€๋ฅผ ํ•˜๋‹ค๋ณด๋ฉด CI/CD๋ผ๋Š” ๋‹จ์–ด๋ฅผ ํ•œ๋ฒˆ์ฏค ์ ‘ํ•ด๋ณด์…จ์„ํ…๋ฐ์š”, ๋ฐฐํฌ ์ž๋™ํ™”๋Š” CD์— ํ•ด๋‹นํ•ฉ๋‹ˆ๋‹ค.

CI/CD๋Š” ์•ฑ ๊ฐœ๋ฐœ ๋‹จ๊ณ„์— ์ž๋™ํ™”๋ฅผ ํ†ตํ•ฉํ•˜๋Š” ์•ฑ ์ œ๊ณต ๋ฐฉ์‹์œผ๋กœ, ์ง€์†์  ํ†ตํ•ฉ(Continuous Integration)/์ง€์†์  ์ œ๊ณต ๋˜๋Š” ๋ฐฐํฌ(Continuous Deployment ๋˜๋Š” Delivery)๋ฅผ ๋œปํ•ฉ๋‹ˆ๋‹ค.

๋ฐฐํฌ๋ฅผ ์ž๋™ํ™” ํ•ด์•ผํ•˜๋Š” ์ด์œ ?

๊ทธ๋ ‡๋‹ค๋ฉด ๋ฐฐํฌ ์ž๋™ํ™”๋Š” ์™œ ํ•„์š”ํ• ๊นŒ์š”?

๋‹น์—ฐํžˆ ๋ฐฐํฌ๋ฅผ ์ž๋™ํ™”ํ•˜์ง€ ์•Š๊ณ , ์ˆ˜๋™์œผ๋กœ ํ•  ์ˆ˜๋„ ์žˆ๊ฒ ์ฃ . ํ•˜์ง€๋งŒ, ์ˆ˜๋™์œผ๋กœ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์€ ์‹œ๊ฐ„๋„ ์˜ค๋ž˜ ๊ฑธ๋ฆฌ๊ณ  ๋ฒˆ๊ฑฐ๋กญ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๋งŒ์•ฝ ์ด ๊ณผ์ •์—์„œ ์‹ค์ˆ˜๊ฐ€ ์ƒ๊ธด๋‹ค๋ฉด ๋ฐฐํฌํ•˜๋Š” ๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์€ ๋” ๋Š˜์–ด๋‚˜๊ฒ ์ฃ .

๋นˆ๋ฒˆํ•œ ๋ฐฐํฌ๊ฐ€ ์ด๋ฃจ์–ด์ง€๋Š” ์„œ๋น„์Šค์—์„œ๋Š” ๋ฐฐํฌ ๋ฃฐ์„ ํ•œ๋ฒˆ ์ •ํ•ด๋†“๊ณ  ์ž๋™์œผ๋กœ ๋ฐฐํฌ ๊ณผ์ •์ด ์ง„ํ–‰๋˜๋„๋ก ํ•ด์„œ ๋ฐฐํฌ์— ๋“œ๋Š” ์ธํ’‹์„ ์ค„์ด๋Š” ๊ฒƒ์ด ํšจ์œจ์„ฑ์„ ๋†’์ด๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. 

์ €์˜ ๊ฒฝ์šฐ, ๊ธฐ์กด ํŒ€ํ”„๋กœ์ ํŠธ์—์„œ QA๋ฅผ ์ง„ํ–‰ํ•˜๊ฑฐ๋‚˜ ์•ฑ์Šคํ† ์–ด ์‹ฌ์‚ฌ ์ œ์ถœ ์‹œ ๋ฐฐํฌ ๊ณผ์ •์ด ๋ฒˆ๊ฑฐ๋กญ๊ณ  ์‹œ๊ฐ„๋„ ๋งŽ์ด ์†Œ์š”๋จ์„ ๋Š๊ผˆ์Šต๋‹ˆ๋‹ค.

์‹ฌ์‚ฌ์— ํ•„์š”ํ•œ ๋นŒ๋“œ ์ œ์ถœ ์‹œ, ํ…Œ์ŠคํŠธํ”Œ๋ผ์ดํŠธ์— ๋ฒ ํƒ€ ๋ฒ„์ „์„ ๋ฐฐํฌํ•ด์„œ ์ด๋ฅผ ์‹ฌ์‚ฌ์— ํฌํ•จ์‹œ์ผœ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ฒ ํƒ€ ๋ฒ„์ „ ๋ฐฐํฌ์˜ ๊ณผ์ •์€ ์•ฑ Achive - ์—…๋กœ๋“œํ•  ์•ฑ ๋ฒ„์ „ ์„ ํƒ - ๋ฐฐํฌ ๋ฐฉ์‹ ์„ ํƒ - ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์˜ต์…˜ ์„ ํƒ - ์Šฌ๋ž™์œผ๋กœ ํŒ€์›๋“ค์—๊ฒŒ ๋…ธํ‹ฐํ•˜๊ธฐ .. ๋“ฑ ์˜ ๊ณผ์ •์œผ๋กœ ์ง„ํ–‰๋˜๋Š”๋ฐ ์ด ๊ณผ์ •์ด ์ €์—๊ฒŒ๋Š” ๋งค์šฐ ๋ฒˆ๊ฑฐ๋กญ๊ฒŒ ๋Š๊ปด์กŒ์Šต๋‹ˆ๋‹ค. (์‹ฌ์ง€์–ด ์‹œ๊ฐ„๋„ ์ตœ์†Œ 10์—ฌ๋ถ„ ๊ฑธ๋ฆฝ๋‹ˆ๋‹ค..) 

 

๊ทธ๋ฆฌ๊ณ  ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๋Š” ๊ฐœ์ธ ํ”„๋กœ์ ํŠธ ์˜€๊ธฐ์— ๊ธฐํš๋ถ€ํ„ฐ ๋ฐฐํฌ๊นŒ์ง€ ๋ชจ๋“  ์ผ์„ ํ˜ผ์ž ํ•ด์•ผํ–ˆ๊ธฐ์— 

๋ฐฐํฌ๋ฅผ ์ž๋™ํ™”ํ•ด์„œ ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐ ์ฝ”๋“œ ํ’ˆ์งˆ์„ ๋†’์ด๋Š” ์ผ์— ๋” ์‹œ๊ฐ„์„ ๋งŽ์ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ธฐ ์œ„ํ•ด fastlane์ด๋ผ๋Š” ๋„๊ตฌ๋ฅผ ์ด์šฉํ•ด์„œ ๋ฐฐํฌ๋ฅผ ์ž๋™ํ™”ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

fastlane

๊ณต์‹๋ฌธ์„œ์— ๋”ฐ๋ฅด๋ฉด, fastlane์€ iOS ๋ฐ Android ๊ฐœ๋ฐœ์ž๊ฐ€ ์Šคํฌ๋ฆฐ์ƒท ์ƒ์„ฑ, ํ”„๋กœํ•„ ํ”„๋กœ๋น„์ €๋‹ ์ฒ˜๋ฆฌ, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ถœ์‹œ์™€ ๊ฐ™์€ ์ง€๋ฃจํ•œ ์ž‘์—…์„ ์ž๋™ํ™”ํ•  ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.

 

๐Ÿ”ฝ fastlane ๊ณต์‹๋ฌธ์„œ

https://docs.fastlane.tools/

 

fastlane docs

fastlane fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. ๐Ÿš€ It handles all tedious tasks, like generating screenshots, dealing with code signing, and releasing your application. You can start by creati

docs.fastlane.tools

์ฆ‰, fastlane์€ iOS์™€ Android์—์„œ ๋ฐฐํฌ๋ฅผ ์ž๋™ํ™”ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.

fastlane์œผ๋กœ ๋ฐฐํฌ ์ž๋™ํ™”ํ•˜๊ธฐ

1. fastlane ์„ค์น˜

๋จผ์ €, ์„ค์น˜๋ถ€ํ„ฐ ํ•ด์•ผ๊ฒ ์ฃ ? ์ €๋Š” HomeBrew ๋ฅผ ์ด์šฉํ•ด ์„ค์น˜๋ฅผ ํ•ด์ฃผ์—ˆ๋Š”๋ฐ์š”, ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ์‰ฝ๊ฒŒ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

brew install fastlane

HomeBrew๋กœ fastlane ์„ค์น˜ํ•˜๊ธฐ

์ถ”๊ฐ€๋กœ, fastlane์„ ์—…๋ฐ์ดํŠธํ•ด์•ผ ํ•œ๋‹ค๋ฉด bundler๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

gem install bundler

 

bundler๋Š” ์œ„์˜ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์—…๋ฐ์ดํŠธ ์‹œ์—๋Š” bundle update ๋งŒ ์ž…๋ ฅํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

2. fastlane ๊ธฐ๋ณธ ์„ค์ •

fastlane์„ ์ด์šฉํ•ด ์ž๋™ ๋ฐฐํฌ ์„ค์ •์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์‚ฌ์šฉํ•  Xcode ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ๋Š” ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•ด์ฃผ์„ธ์š”! 

๊ทธ๋Ÿฐ ๋‹ค์Œ ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋กœ ๊ธฐ๋ณธ ์„ค์ •์„ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

fastlane init

fastlane init

์œ„์˜ ์Šคํฌ๋ฆฐ์ƒท์„ ๋ณด๋ฉด, Xcode ํ”„๋กœ์ ํŠธ ํŒŒ์ผ์ด ์—†๋Š” ๊ณณ์—์„œ initํ•  ๊ฒฝ์šฐ, sub ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•ด์„œ ์ง„ํ–‰ํ•˜๋ผ๋Š” ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. .xcodeproj ํŒŒ์ผ์ด ์žˆ๋Š” ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•ด์„œ ํ•œ๋ฒˆ ๋” ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด fastlane ํด๋”๊ฐ€ ์ž˜ ์ƒ์„ฑ๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

๊ทธ ๋‹ค์Œ์œผ๋กœ ์–ด๋–ค ์ž‘์—…์„ ํ• ์ง€ ๋ฌป๋Š” ๋ฉ”์„ธ์ง€๊ฐ€ ๋‚˜์˜ค๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. 

์ €๋Š” ํ…Œ์ŠคํŠธ๋‚˜ ์‹ฌ์‚ฌ์— ํ•„์š”ํ•œ testflight beta ๋ฒ„์ „์„ ์ž๋™์œผ๋กœ ๋ฐฐํฌํ•˜๊ณ  ์‹ถ์–ด์„œ 2๋ฒˆ์„ ์„ ํƒํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. (์ด์ œ ์„œ๋น„์Šค ๋ฆด๋ฆฌ์ฆˆ๋„ ์™„๋ฃŒ๋˜์—ˆ์œผ๋‹ˆ App Store์— ์ž๋™์œผ๋กœ ๋ฐฐํฌ๋˜๋„๋ก ์„ธํŒ…๋„ ํ•œ๋ฒˆ ํ•ด๋ด์•ผ๊ฒ ์–ด์š”!)

๊ทธ๋Ÿฌ๋ฉด ํ”„๋กœ์ ํŠธ ํŒŒ์ผ ๊ฒ€์‚ฌ, ํŒจํ‚ค์ง€ ์˜์กด์„ฑ ์ฒดํฌ ๋“ฑ๋“ฑ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์ž‘์—…์„ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์™„๋ฃŒ๊ฐ€ ๋˜๋ฉด, Apple ID๋กœ ๋กœ๊ทธ์ธ ํ•ด๋‹ฌ๋ผ๊ณ  ๋œน๋‹ˆ๋‹ค!
์š”๊ตฌ๋Œ€๋กœ ์• ํ”Œ ๊ณ„๋ฐœ์ž ๊ณ„์ •์˜ ์ด๋ฉ”์ผ๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜๊ณ , ์ด์ค‘์ธ์ฆ 6์ž๋ฆฌ ์ฝ”๋“œ๋„ ์ž…๋ ฅํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. (์ž…๋ ฅ๋œ ๋กœ๊ทธ์ธ ์ •๋ณด๋Š” ๋งฅ์˜ ํ‚ค์ฒด์ธ ๋‚ด์— ์ €์žฅ๋œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.)

์œ„์™€ ๊ฐ™์€ ๋ฉ”์‹œ์ง€๊ฐ€ ๋œจ๋ฉด ๊ธฐ๋ณธ์ ์ธ fastlane ์„ค์ •์€ ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์ด์ œ ํ•ด๋‹น ํด๋”์— ์•„๋ž˜์™€ ๊ฐ™์€ 4๊ฐ€์ง€ ํŒŒ์ผ์ด ์ƒ์„ฑ๋˜์—ˆ์„ ๊ฑฐ์—์š”!

  • Gemfile
  • Gemfile.lock
  • fastlane/Appfile
  • fastlane/Fastfile

3. ๋ฐฐํฌ ์„ค์ •

์ƒ์„ฑ๋œ ํŒŒ์ผ์„ ๊ฐ€์ง€๊ณ  ๋ฐฐํฌ์— ํ•„์š”ํ•œ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์„ค์ •์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์„œ ๋ฐฐํฌ์— ํ•„์š”ํ•œ ์„ค์ •์„ ํ•˜๊ธฐ ์œ„ํ•ด ์ˆ˜์ •ํ•ด์•ผ ํ•  ํŒŒ์ผ์€ Appfile๊ณผ Fastfile์ž…๋‹ˆ๋‹ค.

 

  • Appfile: ID, Identifier ๋“ฑ ๋ฐฐํฌ์— ํ•„์š”ํ•œ ํ•„์ˆ˜์ ์ธ ๊ฐ’ ์„ค์ •
  • Fastfile: ์ž๋™ํ™” ํ•  ๋ฐฐํฌ ๋ฃฐ ์„ค์ •

Appfile

Appfile์—๋Š” Apple ID ๋˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ Bundle Identifier์™€ ๊ฐ™์€ ๋ชจ๋“  fastlane ๋„๊ตฌ์— ์‚ฌ์šฉ๋˜๋Š” ์œ ์šฉํ•œ ์ •๋ณด๊ฐ€ ์ €์žฅ๋˜์–ด ์žˆ์–ด ํ”„๋กœ์ ํŠธ ์š”๊ตฌ ์‚ฌํ•ญ์— ๋งž๋„๋ก ๋” ๋น ๋ฅด๊ฒŒ lane์„ ๋ฐฐ์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์œ„์—์„œ ์„ฑ๊ณต์ ์œผ๋กœ ๋กœ๊ทธ์ธํ–ˆ๋‹ค๋ฉด ์ด๋Ÿฐ์‹์œผ๋กœ ๊ธฐ๋ณธ ๊ฐ’๋“ค์ด ์„ธํŒ…๋ ํ…๋ฐ,

๋งŒ์•ฝ ๊ฐœ์ธํ”„๋กœ์ ํŠธ๊ฐ€ ์•„๋‹ˆ๋ผ ํŒ€ํ”„๋กœ์ ํŠธ๋กœ ์ง„ํ–‰ํ•˜๋ฉฐ ์—ฌ๋Ÿฌ ํŒ€์›๋“ค์ด ํ”„๋กœ๋น„์ €๋‹ ํŒŒ์ผ ๋ฐ ์ธ์ฆ์„œ๋ฅผ ๊ณต์œ ํ•ด์„œ ๊ณต๋™์ž‘์—…์„ ํ•˜๊ฒŒ ๋œ๋‹ค๋ฉด apple_id ๋ถ€๋ถ„์—์„œ ์žฆ์€ ์ถฉ๋Œ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฐ ๊ฒฝ์šฐ์—๋Š” .env ํŒŒ์ผ์„ ์ด์šฉํ•ด ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•˜์—ฌ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Fastfile

Fastfile์—๋Š” fastlane๊ณผ ํ•จ๊ป˜ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์ž๋™ํ™” ๊ตฌ์„ฑ์ด ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

fastlane์— ์‚ฌ์šฉ๋˜๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฃฐ์„ ํ•ด๋‹น ํŒŒ์ผ์—์„œ Ruby ์–ธ์–ด๋กœ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    increment_build_number(build_number: latest_testflight_build_number + 1)
    build_app(scheme: "LuckyVicky")
    upload_to_testflight
    slack(
      message: "TestFlight ๋ฐฐํฌ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค๐Ÿ€",
      slack_url: "์Šฌ๋ž™ webhookURL",
      payload: {
        "Build Date" => Time.new.to_s,
      },
      success: true
    )
  end
end

 

์ €์˜ ๊ฒฝ์šฐ, beta ๋ฒ„์ „์ด ์ •์ƒ์ ์œผ๋กœ testflight์— ๋ฐฐํฌ ์™„๋ฃŒ๋˜๋ฉด, ์Šฌ๋ž™์— ๋…ธํ‹ฐ๊นŒ์ง€ ์ค„ ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •ํ•ด์ฃผ์—ˆ๋Š”๋ฐ์š”!

์ฝ”๋“œ๋Š” ์œ„์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

์ฝ”๋“œ๋ฅผ ์ข€ ์‚ดํŽด๋ณด์ž๋ฉด,

default_platform(:ios)


๊ธฐ๋ณธ ํ”Œ๋žซํผ์„ iOS๋กœ ์„ค์ •ํ•˜์—ฌ fastlane [lane name]์œผ๋กœ ๊ฐ„ํŽธํ•˜๊ฒŒ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    ...
  end
end
๊ธฐ๋ณธ ํ”Œ๋žซํผ ์„ค์ • ์ฝ”๋“œ ์•„๋ž˜๋ถ€ํ„ฐ๋Š” ํ”Œ๋žซํผ์— ๊ด€๋ จ๋œ ๋ชจ๋“  ์ž‘์—…์„ ์ •์˜ํ•˜๋Š” ๋ธ”๋ก์ž…๋‹ˆ๋‹ค.
  • desc "Push a new beta build to TestFlight": ์ด lane์˜ ์„ค๋ช…์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. 
  • lane: [lane name] do ... end: lane์˜ ์ž‘์—… ํ๋ฆ„์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. beta lane์€ TestFlight์— ๋ฒ ํƒ€ ๋นŒ๋“œ๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ์ž๋™ํ™”ํ•ฉ๋‹ˆ๋‹ค.

์ œ๊ฐ€ ์„ค์ •ํ•œ lane์˜ ์ž‘์—… ํ๋ฆ„์„ ์ข€ ๋” ์ž์„ธํžˆ ๋ณผ๊ฒŒ์š”!

increment_build_number(build_number: latest_testflight_build_number + 1)

 

ํ˜„์žฌ TestFlight์— ์˜ฌ๋ผ๊ฐ€ ์žˆ๋Š” ์ตœ์‹  ๋นŒ๋“œ ๋ฒˆํ˜ธ๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ , ๋นŒ๋“œ ๋ฒˆํ˜ธ๋ฅผ 1 ์ฆ๊ฐ€์‹œํ‚ต๋‹ˆ๋‹ค.

build_app(scheme: "LuckyVicky")โ€‹

 

์ง€์ •๋œ scheme("LuckyVicky")์„ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋นŒ๋“œํ•ฉ๋‹ˆ๋‹ค. 

ํ•ด๋‹น lane์— ๋งž๋Š” sheme์„ ์ง€์ •ํ•ด์ฃผ๋ฉด ๋˜๊ฒ ์ฃ ? (beta ๋ฒ„์ „์—์„œ๋Š” debug, ์‹ค์ œ ๋ฐฐํฌ์—์„œ๋Š” release ๋“ฑ)

upload_to_testflight
    slack(
      message: "TestFlight ๋ฐฐํฌ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค๐Ÿ€",
      slack_url: "์Šฌ๋ž™ webhookURL",
      payload: {
        "Build Date" => Time.new.to_s,
      },
      success: true
    )

 

๋นŒ๋“œ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ TestFlight์— ์—…๋กœ๋“œํ•˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. 

์ธ์ฆ์ด ์™„๋ฃŒ๋œ๋‹ค๋ฉด ๋ฐฐํฌํ•˜๊ณ , ์Šฌ๋ž™์— ์•Œ๋ฆผ๊นŒ์ง€ ์ฃผ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ด์Šˆ ๊ณต์œ 

 

์ €๋Š” Fastfile์„ ์ˆ˜์ •ํ•˜๋Š” ๊ณผ์ •์—์„œ ํ•œ๊ฐ€์ง€ ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ์š”, ์š”๊ฑธ ํ•œ ๋ฒˆ ๊ณต์œ ํ•ด๋ณผ๊ฒŒ์š”!

์œ„์™€ ๊ฐ™์ด Fastfile์„ ์ž˜ ์ˆ˜์ •ํ•˜๊ณ , fastlane beta ๋ฅผ ์ž…๋ ฅํ•ด ๋ฐฐํฌ๋ฅผ ํ•ด๋ณด์•˜๋Š”๋ฐ์š”, ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค๐Ÿ’ฅ

์—๋Ÿฌ๋ฅผ ์‚ดํŽด๋ณด๋ฉด,

๊ถŒํ•œ์„ ์–ป๋Š”๋ฐ ์‹คํŒจํ–ˆ๊ณ , 23๋ฒˆ ๋ผ์ธ์—์„œ ์—๋Ÿฌ๊ฐ€ ๋‚˜๊ณ  ์žˆ๊ณ  ipa ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๋Š” ๋ฐ ์‹คํŒจํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— archive๋ฅผ ์—…๋กœ๋“œ ํ•  ์ˆ˜ ์—†๋‹ค.

๋ญ ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๊ณ  ์žˆ๋„ค์š”.

 

fastlane ๋ฌธ์„œ์— Authentication์ด๋ผ๋Š” ํŒŒํŠธ๊ฐ€ ์žˆ์–ด์„œ ์ฐพ์•„๋ณด์•˜์Šต๋‹ˆ๋‹ค.

https://docs.fastlane.tools/getting-started/ios/authentication/

 

Authentication - fastlane docs

Authenticating with Apple services Several fastlane actions communicate with Apple services that need authentication. As this can pose several challenges especially on CI, this document focuses on those challenges, but everything described here can be done

docs.fastlane.tools

 

๋ฌธ์„œ๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด, ๊ฐ€์žฅ ์ฒซ๋ฒˆ์งธ๋กœ AppStore Connect API๋ฅผ ์‚ฌ์šฉํ•˜๋ผ๋Š” ๋‚ด์šฉ์ด ๋‚˜์˜ต๋‹ˆ๋‹ค.

๋ฌธ์„œ์—์„œ ๊ฐ€์ด๋“œํ•ด์ฃผ๋Š”๋Œ€๋กœ App Store Connect > ์‚ฌ์šฉ์ž ๋ฐ ์•ก์„ธ์Šค > ํ†ตํ•ฉ > App Store Connect API ์—์„œ key ๋ฅผ ์ƒ์„ฑํ•˜๊ณ  json ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด์„œ ์ ์šฉํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

 

๋ฌธ์„œ์—์„œ ๋งค์šฐ ์ž์„ธํžˆ ํ‚ค ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•๊นŒ์ง€ ์•Œ๋ ค์ค๋‹ˆ๋‹ค!

ํ‚ค ๊ฐ’์€ ๋ฏผ๊ฐํ•œ ์ •๋ณด์ด๋‹ˆ ๋ฆฌ๋ชจํŠธ์— ์˜ฌ๋ฆฌ์ง€ ์•Š๋„๋ก ์ฃผ์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.(์ €์˜ ๊ฒฝ์šฐ.gitignore์— ํŒŒ์ผ ์ถ”๊ฐ€)

์ด๋ ‡๊ฒŒ ์ด์Šˆ๊นŒ์ง€ ํ•ด๊ฒฐํ•œ ์ตœ์ข…์ ์ธ Fastfile ์ฝ”๋“œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    increment_build_number(build_number: latest_testflight_build_number + 1)
    build_app(scheme: "LuckyVicky")
    upload_to_testflight(
      api_key_path: "fastlane/key.json"
    )
    slack(
      message: "TestFlight ๋ฐฐํฌ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค๐Ÿ€",
      slack_url: "https://hooks.slack.com/services/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",
      payload: {
        "Build Date" => Time.new.to_s,
      },
      success: true
    )
  end
end

 

์ด์ œ ์ €์žฅํ•˜๊ณ  fastlane beta๋ฅผ ์ž…๋ ฅํ•ด์ฃผ๋ฉด?!? ์•„๋ž˜์™€ ๊ฐ™์ด ์„ฑ๊ณต ๋ฉ”์‹œ์ง€๊ฐ€ ๋œน๋‹ˆ๋‹ค!

์„ฑ๊ณต ๋ฉ”์‹œ์ง€ ํ™•์ธ
์Šฌ๋ž™ ๋ฉ”์„ธ์ง€๊นŒ์ฅ ์„ฑ๊ณต!!

 

๋ฐฐํฌ ์ž๋™ํ™”๋ฅผ ์ฒ˜์Œ ํ•ด๋ณด๋Š” ๊ฒƒ์ด๋ผ ์„ค์ • ๊ณผ์ •์ด ์‰ฝ์ง€๋Š” ์•Š์•˜์ง€๋งŒ, ๊ฐœ์ธ์ ์œผ๋กœ ๋งค์šฐ ๋งŒ์กฑํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค!

๋ช…๋ น์–ด ํ•˜๋‚˜๋กœ archive ๋ถ€ํ„ฐ testflight์— ์˜ฌ๋ฆฌ๋Š” ๊ฒƒ๊นŒ์ง€ ์ž๋™์œผ๋กœ ๋˜๋‹ˆ, ๊ฐœ๋ฐœ๊ณผ์ •์—๋งŒ ์ง‘์ค‘ํ•  ์ˆ˜ ์žˆ์–ด ๋งค์šฐ ํŽธํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. 

๊ธ‰ํ•˜๊ฒŒ ์‹ฌ์‚ฌ๋ฅผ ์˜ฌ๋ฆฌ๊ฑฐ๋‚˜, ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด์•„์•ผ ํ•  ๋•Œ๋„ ๋งค์šฐ ์œ ์šฉํ•œ ๊ฒƒ ๊ฐ™์•„์š”.

๋ฌธ์„œ๋„ ๋„ˆ๋ฌด ์ž˜ ์ •๋ฆฌ๋˜์–ด์žˆ์–ด์„œ ์‹œ๋„ํ•ด๋ณผ๋งŒํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

fastlane์œผ๋กœ ๋ฐฐํฌ ์ž๋™ํ™”๋ฅผ ์‹œ๋„ํ•ด๋ณด์‹œ๋Š” ๋ถ„๋“ค๊ป˜ ์ด ๊ธ€์ด ์กฐ๊ธˆ์ด๋‚˜๋งˆ ๋„์›€์ด ๋˜๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค๐Ÿ€๐Ÿ€


[์ฐธ๊ณ  ์ž๋ฃŒ]

 

CI/CD๋ž€? - ServiceNow

CI/CD๋Š” ์ง€์†์  ํ†ตํ•ฉ, ์ œ๊ณต ๋ฐ ๋ฐฐํฌ๋ฅผ ํฌํ•จํ•œ ์•ฑ ๊ฐœ๋ฐœ ๋‹จ๊ณ„๋ฅผ ์ž๋™ํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

www.servicenow.com

 

fastlane docs

fastlane fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. ๐Ÿš€ It handles all tedious tasks, like generating screenshots, dealing with code signing, and releasing your application. You can start by creati

docs.fastlane.tools

 

GitHub - fastlane/fastlane: ๐Ÿš€ The easiest way to automate building and releasing your iOS and Android apps

๐Ÿš€ The easiest way to automate building and releasing your iOS and Android apps - fastlane/fastlane

github.com

 

iOSโ€Š—โ€Š๋ฐฐํฌ ์ž๋™ํ™”, Fastlane ์‹œ์ž‘๋ถ€ํ„ฐ ์ ์šฉ๊นŒ์ง€

Fastlane์˜ ์„ค์น˜ ๋ฐฉ๋ฒ•๋ถ€ํ„ฐ ์ธ์ฆ ๋ฐฉ๋ฒ•, beta, release ์˜ˆ์‹œ๊นŒ์ง€ ์•Œ์•„๋ณด์ž

medium.com

 

[iOS] fastlane ์ด์šฉํ•œ ๋ฐฐํฌ ์ž๋™ํ™” (TestFlight ํŽธ)

๐Ÿš€ fastlane ์„ ์ด์šฉํ•œ TestFlight ๋ฐฐํฌ ์ž๋™ํ™”!

velog.io