Focus On Develop ๐ŸคŸ๐ŸคŸ

[iOS] Fastlane์„ ํ†ตํ•œ ๋นŒ๋“œ/๋ฐฐํฌ ์ž๋™ํ™” ๋ณธ๋ฌธ

๊ณตํ†ต/ํ˜‘์—…Tool

[iOS] Fastlane์„ ํ†ตํ•œ ๋นŒ๋“œ/๋ฐฐํฌ ์ž๋™ํ™”

๋ˆ„๋ฆฌ๋‹ฌ์ดํ‹€ 2021. 4. 9. 17:12

์˜ค๋Š˜์€ App Store๋กœ ์•ฑ์„ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ Fastlane์„ ํ†ตํ•ด ์ž๋™ํ™” ํ•˜๋Š”๊ฑธ ํ•ด๋ณด๊ณ ,

๊ทธ ๊ณผ์ •์—์„œ ๋งŒ๋‚œ ์—๋Ÿฌ๋‚˜ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ์ •๋ฆฌํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!!

 

์ง€๊ธˆ ์ œ๊ฐ€ ๊ฐœ๋ฐœํ•˜๋Š” ์„œ๋น„์Šค๋Š” ํ‰๊ท ์ ์œผ๋กœ ๋ณด๋ฉด ํ•œ๋‹ฌ์— 1~2ํšŒ ์‹ ๊ทœ ๋ฒ„์ „์„ ์ถœ์‹œ ํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„์š”.

์‚ฌ์‹ค ๋ฐฐํฌํ•˜๋Š” ๋นˆ๋„๋„ ๊ทธ๋ ‡๊ฒŒ ๋งŽ์ง€ ์•Š๊ณ , ๊ทธ ๊ณผ์ •์ด ๋งŽ์ด ๋ณต์žกํ•œ ๊ฒƒ(?)๋„ ์•„๋‹ˆ๋ผ์„œ..

๋”ฑํžˆ ๋ถˆํŽธํ•˜๊ณ  ๊ท€์ฐฎ๋‹ค๊ณ  ์ƒ๊ฐ์„ ์•ˆํ–ˆ๋˜ ๊ฒƒ ๊ฐ™์•„์š”!

 

๊ทธ๋Ÿฐ๋ฐ.. ์ตœ๊ทผ์— ๊ฐ‘์ž๊ธฐ ์ž๋™ํ™”๋ฅผ ํ•ด์•ผ๊ฒ ๋‹ค, ๋ผ๊ณ  ์ƒ๊ฐ์ด ๋ฌธ๋“ ๋“ค์—ˆ๋Š”๋ฐ์š”!

์•ฑ์Šคํ† ์–ด์— ์•ฑ์„ ๋ฐฐํฌํ•˜๊ณ , ์—…๋กœ๋“œ ์™„๋ฃŒ๋˜์—ˆ๋‹ค, ํ…Œ์ŠคํŠธ ํ”Œ๋ผ์ดํŠธ ๋ฐฐํฌ๋˜์—ˆ๋‹ค, ๋“ฑ๋“ฑ ํ…Œ์Šคํ„ฐ ์กฐ์ง์—๊ฒŒ ๊ณต์œ ๋ฅผ ํ•ด์•ผํ•˜์ฃ .

๊ทผ๋ฐ ์•ฑ์Šคํ† ์–ด์— ์—…๋กœ๋“œํ•˜๊ณ , ๊ทธ ํ›„์— ๋‚ด๋ถ€์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ์‹œ๊ฐ„์ด ์ •ํ•ด์ ธ์žˆ์ง€ ์•Š๊ณ  ๊ฐ€๋ณ€์ ์ด์ฃ ~?

 

๊ทธ๋Ÿผ ๊ทธ๋•Œ๋งˆ๋‹ค ๋ชจ๋‹ˆํ„ฐ๋ง ํ•˜๋ฉด์„œ ์ฒ˜๋ฆฌ๋˜๋Š” ๊ณผ์ •์„ ๋“ค์—ฌ๋‹ค๋ณด๊ณ  ์žˆ์–ด์•ผ ํ•˜๋”๋ผ๊ตฌ์š” ใ…‹ใ…‹

๊ทธ๊ฑธ ์™œ ๋ฒˆ๊ฑฐ๋กœ์šด ๊ณผ์ •์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์ง€ ์•Š์•˜์—ˆ๋Š”์ง€ ๐Ÿ˜‚

 

์„œ๋‘๊ฐ€ ๊ธธ์–ด์กŒ๋„ค์š”!! 

 


 

๋จผ์ € fastlane ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์š”! ์ด ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด์„œ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค~!

docs.fastlane.tools/getting-started/ios/setup/

 

Setup - fastlane docs

Getting started with fastlane for iOS Setup Xcode for fastlane xcode-select --install Installing fastlane fastlane can be installed multiple ways. The preferred method is with Bundler. fastlane can also be installed directly through with Homebrew (if on ma

docs.fastlane.tools

 

๊ธฐ์กด์— ์šฐ๋ฆฌ๊ฐ€ ์ˆ˜๋™์œผ๋กœ App Store์— ์•ฑ์„ ๋ฐฐํฌํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ–ˆ์ฃ ~?

  • ๋ฒ„์ „๊ณผ ๋นŒ๋“œ๋ฅผ ์˜ฌ๋ฆฐ๋‹ค.
  • ๋นŒ๋“œํ•˜๊ณ , ํ•„์š”์‹œ cocoapods ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๊ฑฐ๋‚˜ ์ธ์Šคํ†จํ•œ๋‹ค.
  • Analyze ์‹คํ–‰ํ•˜๊ณ  ๊ธฐ๋‹ค๋ฆผ
  • Archive ์‹คํ–‰ํ•˜๊ณ  ๊ธฐ๋‹ค๋ฆผ
  • Archive๊ฐ€ ๋‹ค ๋˜๋ฉด App Store Connect ์— ์—…๋กœ๋“œ
  • TestFlight ์ถœ์‹œ, Slack์— ์—…๋กœ๋“œ ๋ฐ ๋ฐฐํฌ๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์Œ์„ ๊ณต์œ 
  • ์ค€๋น„๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์‹ฌ์‚ฌ ์š”์ฒญ, ์‹ฌ์‚ฌ ํ†ต๊ณผํ•˜๋ฉด ์—…๋ฐ์ดํŠธ ๋กœ๊ทธ ์ž‘์„ฑํ›„ ์Šคํ† ์–ด ์ถœ์‹œ

์†”์งํžˆ ์ˆ˜๋™์œผ๋กœ ํ•ด๋„ ๋ง‰ ๋ฒˆ๊ฑฐ๋กœ์šด ์ž‘์—…์€ ์•„๋‹๊ฑฐ์—์š”. ๊ทธ๋ž˜๋„ ์šฐ๋ฆฌ๋Š” ๊ฐœ๋ฐœ์ž์ž–์•„์š”~? ์ž๋™์œผ๋กœ ํ•˜๊ฒŒ๋” ํ•ด์•ผ์ฃ !!

์œ„ ๊ณผ์ •์ค‘์— ํŒŒ๋ž€์ƒ‰์œผ๋กœ ํ‘œ์‹œํ•œ ๋ถ€๋ถ„์„ ์ž๋™ํ™” ํ•ด๋ณผ๊ฑฐ์—์š”! ๐ŸคŸ

 

 

XCode Command Line Tool ์„ค์น˜

๋จผ์ € xcode Command Line Tools๋ฅผ ์„ค์น˜ํ•ด์•ผ ๋˜์š”.

๋งŒ์•ฝ ์„ค์น˜๋˜์–ด ์žˆ๋Š” Xcode์˜ ๋ฒ„์ „์ด Beta๋ฒ„์ „์ด๋ฉด,(ํ˜น์€ Mac OS ๋ฒ„์ „ ์—…๊ทธ๋ ˆ์ด๋“œ ๋“ฑ์˜ ๋‹ค๋ฅธ ์ด์œ ๋กœ) Command Line Tools์ด ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์„๊ฑฐ์—์š”.

xcode-select --install

๋งŒ์•ฝ ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋ฉด ์œ„ ๋ช…๋ น์–ด๋กœ CLT๋ฅผ ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค!

์„ค์น˜๋˜์–ด ์žˆ๋Š” ์ƒํƒœ์—์„œ ์‹คํ–‰ํ•ด๋„ ์ƒ๊ด€์—†์–ด์š”. ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๊ณ  ์•Œ๋ ค์ค๋‹ˆ๋‹ค! ๐Ÿ‘

 

Fastlane ์„ค์น˜

๋‹ค์Œ์€ fastlane์„ ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค.

์ €๋Š” Homebrew๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ์„ค์น˜ํ–ˆ์–ด์š”.

brew install fastlane

gem์„ ์‚ฌ์šฉํ•˜๋Š” ๋“ฑ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์œผ๋กœ ์„ค์น˜ํ•˜๋ ค๋ฉด ํ™ˆํŽ˜์ด์ง€๋ฅผ ์ฐธ๊ณ ํ•ด๋ณด์‹œ๊ธฐ๋ฅผ ๋ฐ”๋ž˜์š”~ ๐Ÿ™

 

Fastlane Setting

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์œผ๋ฉด, ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ๋Š” ๋ฃจํŠธ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•ด์„œ, ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ด์ฃผ์„ธ์š”!

fastlane init

๊ทธ๋Ÿผ ์ด๋ ‡๊ฒŒ ์–ด๋–ค ์ž‘์—…์„ ์ž๋™ํ™”์ฒ˜๋ฆฌ ํ•˜๋„๋ก ๋งŒ๋“ค๋ž˜? ํ•˜๊ณ  ๋ณด๊ธฐ๋ฅผ ์ค๋‹ˆ๋‹ค.

์ €๋Š” ์•ฑ์Šคํ† ์–ด์— ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ๊นŒ์ง€ ํ•ด๋ณด๊ธฐ๋กœ ํ–ˆ์œผ๋‹ˆ, 3๋ฒˆ์„ ์„ ํƒํ•ด์ฃผ์—ˆ์–ด์š”.

 

์—ฌ๊ธฐ์„œ ์ €๋Š” ์ด๋Ÿฐ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ์–ด์š”.

Unable to locate Xcode. Please make sure to have Xcode installed on your machine

์‘..? Xcode๊ฐ€ ์„ค์น˜์•ˆ๋˜์–ด ์žˆ๋‹ค๊ณ ..!? ๋‹นํ™ฉํ•˜์ง€ ์•Š๊ณ  ๊ตฌ๊ธ€๋ง ๐Ÿ‘‰

Xcode Preference > Locations์—์„œ, Command Line Tools๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ์„ ํƒํ•ด์ฃผ์ง€ ์•Š์€ ๊ฒฝ์šฐ์— ๋งˆ์น˜ Xcode๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ์—๋Ÿฌ ๋ฉ”์„ธ์ง€๊ฐ€ ๋ฐœ์ƒํ•˜๋”๋ผ๊ตฌ์š”!! ์ €๋Š” ์ด๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์•˜๊ณ , ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ ๋ฒ„์ „์œผ๋กœ ์ง€์ •ํ•ด์ฃผ์—ˆ์–ด์š”!

 

๊ทธ๋ฆฌ๊ณ  ๋‹ค์‹œ fastlane init ๐Ÿ‘‰

์˜ค์˜ค~ ์ด๋ฒˆ์—๋Š” ์—๋Ÿฌ๋ฅผ ์•ˆ๋ฐ›๊ณ  ํ†ต๊ณผํ–ˆ์–ด์š”!! Apple ๊ณ„์ •์„ ์ž…๋ ฅํ•˜๋ผ๊ณ  ํ•˜๋„ค์š”.

๋กœ๊ทธ์ธ ์ž˜ ํ•ด์ฃผ์‹œ๊ตฌ์š”~!! ์ค‘๊ฐ„์— app ์— ๋Œ€ํ•œ P/W๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค๋Š” ์ด์œ ๋กœ ์ง„ํ–‰์ด ์•ˆ๋˜์—ˆ๋Š”๋ฐ, ๊ทธ ํ™”๋ฉด์€ ์บก์ณ๋ฅผ ๋ชปํ•ด์„œ ๋ณด์—ฌ์ค„ ์ˆ˜๋Š” ์—†๋„ค์š” ๐Ÿ˜ญ ๋Œ€์‹  ์—๋Ÿฌ ๋ฉ”์„ธ์ง€์— "app์— ๋Œ€ํ•œ P/W๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•˜๋ฉฐ, ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์ด๋Ÿฌ์ด๋Ÿฌํ•˜๋‹ค"๋ผ๊ณ  ์ƒ์„ธํ•˜๊ฒŒ ๋‚˜์™€์žˆ์œผ๋‹ˆ ์ฒœ์ฒœํžˆ ์ฝ์–ด๋ณด์‹œ๊ณ  ํ•ด๋ณด์‹œ๊ธธ ๋ฐ”๋ž˜์š” ๐Ÿ™

 

์„ค์ •ํ•˜๋Š” ๊ณผ์ •์—์„œ, ์•ฑ์˜ metadata๋ฅผ fastlane์„ ํ†ตํ•ด ๊ด€๋ฆฌํ• ๊ฑด์ง€ ๋ฌผ์–ด๋ณด๋„ค์š”!

์ €๋Š” ์ด๊ฑด ๊ด€๋ฆฌํ•˜์ง€ ์•Š๊ธฐ๋กœ ํ–ˆ์–ด์š”. ์—ฌ๊ธฐ์„œ y๋กœ ํ•ด๋ดค๋”๋‹ˆ, ์•ฑ์Šคํ† ์–ด ์—…๋กœ๋“œ ๊ณผ์ •์— metadata์— ๋Œ€ํ•œ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ๋ณด์—ฌ์ฃผ๋ฉด์„œ, ์ด๋Œ€๋กœ ์ง„ํ–‰ํ• ๊นŒ์š”? ๋ผ๋Š” ์งˆ๋ฌธ์— ํ•œ๋ฒˆ ์‘๋‹ต์„ ํ•ด์ค˜์•ผ ํ•˜๋Š” ๊ท€์ฐฎ์€(?) ์ผ์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค ๐Ÿ˜‚

์–ด์ฐจํ”ผ metadata๋Š” ์•ฑ ์‹ฌ์‚ฌ์š”์ฒญ ํ•˜๊ธฐ ์ „์— ํ•œ๋ฒˆ ๊ฒ€ํ† ํ• ๊ฑฐ๋‹ˆ๊นŒ ๊ดœ์ฐฎ์„ ๊ฒƒ ๊ฐ™์•˜์–ด์š”!!

 

๊ทธ๋ฆฌ๊ณ  2~3๋ฒˆ ์„ธํŒ…๋œ ๋‚ด์šฉ์„ ์„ค๋ช…ํ•ด์ฃผ๋ฉด์„œ ์—”ํ„ฐ๋ฅผ ์น˜๋ผ๊ณ  ํ•˜๋ฉด ์—”ํ„ฐ๋ฅผ ์ณ์ค๋‹ˆ๋‹ค.

์„ธํŒ… ์™„๋ฃŒ~ ๊ฐ„๋‹จ-๐Ÿง‘‍๐Ÿ’ป

 

Fastfile ์ˆ˜์ •ํ•˜๊ธฐ

๋‹ค์‹œ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ๊ฒฝ๋กœ๋ฅผ ๋ณด๋ฉด, fastlane์ด๋ผ๋Š” ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์ƒ๊ฒผ์„๊ฑฐ์—์š”.

default_platform(:ios)

platform :ios do
  desc "Push a new release build to the App Store"
  lane :release do
    increment_build_number(xcodeproj: "YOUR_PROJECT.xcodeproj")
    build_app(workspace: "YOUR_PROJECT.xcworkspace", scheme: "YOUR_PROJECT")
    upload_to_app_store
  end
end

fastlane ํด๋”์— ๋“ค์–ด๊ฐ€๋ณด๋ฉด Fastfile์ด ์žˆ๋Š”๋ฐ  ์ด๋Ÿฐ์‹์œผ๋กœ ๊ธฐ๋ณธ์ ์ธ Script ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค.

script๋Š” ๊ฐ„๋žตํ•˜๊ฒŒ ์„ค๋ช…ํ•˜๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ๋™์ž‘ํ•ด์š”.

  • lane :release do ๐Ÿ‘‰ release๋ผ๋Š” fastlane ๋ช…๋ น์–ด๋ฅผ ๋งŒ๋“ค๊ณ , ์ด ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์•„๋ž˜์˜ ๋™์ž‘์„ ์ˆ˜ํ–‰ํ•ด์ฃผ์„ธ์š”.
  • increment_build_number ๐Ÿ‘‰ ํ˜„์žฌ ๋นŒ๋“œ ๋ฒ„์ „์—์„œ ํ•˜๋‚˜๋ฅผ ์˜ฌ๋ ค์ฃผ์„ธ์š”.
  • build_app ๐Ÿ‘‰ ์•ฑ์„ ๋นŒ๋“œํ•ด์ฃผ์„ธ์š”.
  • upload_to_app_store ๐Ÿ‘‰ ์•ฑ์Šคํ† ์–ด์— ์•ฑ์„ ์—…๋กœ๋“œํ•ด์ฃผ์„ธ์š”.

์‰ฝ์ฃ ~?

Script์— ๋Œ€ํ•œ ์ƒ์„ธํ•œ ๋‚ด์šฉ์ด๋‚˜ ์ถ”๊ฐ€๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Method๋Š” ์œ„์—์„œ ์†Œ๊ฐœ๋“œ๋ฆฐ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์„œ ์ฐพ์•„๋ณผ ์ˆ˜ ์žˆ์–ด์š”.

 

๊ทธ๋Ÿผ ๋ฐฐํฌํ•ด๋‹ฌ๋ผ๋Š” ๋ช…๋ น์–ด๋ฅผ ๋งŒ๋“ค์—ˆ์œผ๋‹ˆ, ํ•œ๋ฒˆ ๋ฐฐํฌ๋ฅผ ํ•ด๋ณด์ฃ !!

 

Fastlane์œผ๋กœ ๋นŒ๋“œ, ๋ฐฐํฌํ•˜๊ธฐ

์šฐ๋ฆฌ๊ฐ€ ์œ„์—์„œ ๋งŒ๋“ค์—ˆ๋˜ release๋ผ๋Š” ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ด๋ณผ๊ฒŒ์š”.

fastlane release

๋ญ”๊ฐ€ ๋ง‰ ๋นŒ๋“œ๋˜๊ณ  ์•„์นด์ด๋น™๋˜๊ธฐ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค!! ์ฒ˜์Œ์ด๋‹ˆ๊นŒ(?) ํ•œ๋ฒˆ ์ง€์ผœ๋ด์ค๋‹ˆ๋‹ค ใ…‹ใ…‹

๋ณ„์ผ ์—†์ด ๋งˆ๋ฌด๋ฆฌ ๋˜์—ˆ๊ณ , ๋ช‡๋ถ„ ๋’ค์— App Store Connect์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•˜๋„ค์š”!! ๐Ÿ‘

์™„๋ฃŒ๋˜๋ฉด ์ด๋ ‡๊ฒŒ script์—์„œ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ–ˆ๋˜ Method๋“ค์— ๋Œ€ํ•œ ์ˆ˜ํ–‰์‹œ๊ฐ„ ๋“ฑ๋“ฑ ์ „์ฒด์ ์ธ ํ†ต๊ณ„์ •๋ณด๋ฅผ ๋ฟŒ๋ ค์ฃผ๋ฉด์„œ ์™„๋ฃŒ๋˜๋„ค์š”!

๊ทธ๋ฆฌ๊ณ  ์ž ์‹œ ๊ธฐ๋‹ค๋ ค ๋ณด๋‹ˆ, App Store Connect์— ์ •์ƒ์ ์œผ๋กœ ์—…๋กœ๋“œ ๋œ ๊ฑธ ๋ณผ ์ˆ˜ ์žˆ์—ˆ์–ด์š”!! ใ…Žใ…Ž

 

 

์˜ค์ผ€์ด ์ข‹์•„.. ๊ทผ๋ฐ ์ฒ˜์Œ์— ๋ชฉํ‘œ๋กœ ์žก์€ ๊ฒƒ๊ณผ๋Š” ๋‹ค๋ฅด์ž–์•„..!?

์ € ์—…๋กœ๋“œ ๋˜๋Š” ๊ณผ์ •์„ ๋ˆˆํŒ…ํ•˜์ง€ ์•Š๊ณ  ์™„๋ฃŒ๋˜๋ฉด ์•Œ์•„์„œ Slack์œผ๋กœ ๊ณต์œ ํ•ด์ฃผ๊ธฐ๋กœ ํ–ˆ์ž–์•„..!?

 

๋„ค! ๊ทธ๋ž˜์„œ ์ง€๊ธˆ๋ถ€ํ„ฐ๋Š” Slack๊ณผ ์—ฐ๋™์„ ํ•ด๋ณผ๊ฑฐ์—์š”.

 

Fastlane ์ž‘์—… ์ˆ˜ํ–‰ ํ›„ Slack์œผ๋กœ ๋ฉ”์„ธ์ง€ ๋ณด๋‚ด๊ธฐ

docs.fastlane.tools/actions/slack/

 

slack - fastlane docs

Create an Incoming WebHook and export this as SLACK_URL. Can send a message to #channel (by default), a direct message to @username or a message to a private group group with success (green) or failure (red) status. It is recommended to add the above actio

docs.fastlane.tools

์š”์ฆ˜์€ ํ˜‘์—… ํˆด๋กœ ๋ฉ”์‹ ์ €๋Š” ์•„๋งˆ ๋Œ€๋ถ€๋ถ„ Slack์„ ์‚ฌ์šฉํ•  ๊ฑฐ์—์š”. ๊ทธ๋ž˜์„œ ๊ทธ๋Ÿฐ์ง€..

์ด๋ ‡๊ฒŒ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์„œ๋„ slack๊ณผ ์—ฐ๋™์€ ์ด๋ ‡๊ฒŒ ํ•˜์„ธ์š”~ ํ•˜๊ณ  ์ž˜ ์„ค๋ช…๋˜์–ด ์žˆ๋„ค์š” ๐Ÿ˜Ž

 

์œ„์—์„œ fastlane/fastFile์—์„œ ๋ช…๋ น์–ด๋ฅผ ๋งŒ๋“ค๊ณ  Script๋ฅผ ์ž‘์„ฑํ•ด์คฌ๋˜ ๊ฒƒ์ฒ˜๋Ÿผ Slack ๋ฉ”์„ธ์ง€๋ฅผ ๋ณด๋‚ด๋„๋ก lane์„ ๋งŒ๋“ค์–ด ๋ณผ๊ฒŒ์š”.

lane :send_slack do
    version = get_version_number(
	xcodeproj: "PROJECT_NAME.xcodeproj", 
	target: "PROJECT_NAME"
    )
    build = get_build_number(xcodeproj: "PROJECT_NAME.xcodeproj") 
    
    slack(
      message: "์•ฑ์Šคํ† ์–ด ์—…๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.",
      channel: "#fastlanetest",
      slack_url: "WEBHOOK_URL",
      default_payloads: [:lane, :test_result, :git_branch, :git_author],
      payload: {
	"Version": version + " (" + build + ")"
      }
    )
   end

๋ ์šฉ~ ๊ฑฑ์ •๋งˆ์„ธ์š”!! ์œ„์—์„œ ํ–ˆ๋˜ ๊ฒƒ์ฒ˜๋Ÿผ ํ•˜๋‚˜์”ฉ ์‚ดํŽด๋ณผ๊ฑฐ์—์š”.

  • lane :send_slack do ๐Ÿ‘‰ send_slack์ด๋ผ๋Š” ๋ช…๋ น์–ด๋ฅผ ๋งŒ๋“ค๊ณ , ์•„๋ž˜์™€ ๊ฐ™์€ ๋™์ž‘์„ ์ˆ˜ํ–‰ํ• ๊ฑฐ์—์š”.
  • get_version_number ๐Ÿ‘‰ ์•ฑ์˜ ๋ฒ„์ „์„ ๊ฐ€์ ธ์˜ค์„ธ์š”.
  • get_build_number ๐Ÿ‘‰ ์•ฑ์˜ ๋นŒ๋“œ๋ฒˆํ˜ธ๋ฅผ ๊ฐ€์ ธ์˜ค์„ธ์š”.
  • slack() ๐Ÿ‘‰ Slack ๋ฉ”์„ธ์ง€๋ฅผ ๊ตฌ์„ฑํ•ด์ฃผ์„ธ์š”. ๋‚ด์šฉ์€ ( ) ์•ˆ์— ์žˆ๋Š” ๋‚ด์šฉ์ฒ˜๋Ÿผ์š”!
  • message ๐Ÿ‘‰ ๋ฉ”์„ธ์ง€ ํƒ€์ดํ‹€์€ ์ด๋ ‡๊ฒŒ ํ•ด์ฃผ์„ธ์š”.
  • channel ๐Ÿ‘‰ ์ด ์ฑ„๋„์— ๊ณต์œ ํ•ด์ฃผ์„ธ์š”.
  • slack_url ๐Ÿ‘‰ ์ด ์ฑ„๋„์˜ url์€ ์ด๊ฑฐ์—์š”.
  • default_payloads ๐Ÿ‘‰ ๋””ํดํŠธ๋กœ ์ด๋Ÿฐ์ด๋Ÿฐ ์ •๋ณด๋ฅผ ๋„ฃ์–ด์ฃผ์„ธ์š”. 
  • payload ๐Ÿ‘‰ ์ถ”๊ฐ€๋กœ ์ด๋Ÿฐ ์ •๋ณด๋ฅผ ๊ฐ™์ด ๋ณด๋‚ด์ฃผ์„ธ์š”.

์‰ฝ..์ฃ ..!? ์ €๋Š” ์–ด๋–ค ๋ฒ„์ „, ์–ด๋–ค ๋นŒ๋“œ๋กœ ํ…Œ์ŠคํŠธํ• ์ง€ ๊ฐ™์ด ๊ณต์œ ํ•˜๊ธฐ ์œ„ํ•ด ๋ฒ„์ „๊ณผ ๋นŒ๋“œ๋ฒˆํ˜ธ๋ฅผ ๊ฐ™์ด ์ „์†กํ•˜๊ฒŒ๋” ํ•ด์คฌ์–ด์š”.

get_version_number ์ด๋Ÿฐ ๋…€์„๋“ค์„ fastlane action ์ด๋ผ๊ณ  ํ•ด์š”.

์—„์ฒญ ๋‹ค์–‘ํ•œ action์ด ์žˆ๊ณ , ์ƒ์„ธํ•œ ๋‚ด์šฉ์€ ๊ณต์‹ํ™ˆํŽ˜์ด์ง€ ์—ฌ๊ธฐ์— ์ž˜ ๋‚˜์™€์žˆ๋‹ต๋‹ˆ๋‹ค.

 

Slack ๋ฉ”์„ธ์ง€๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๋ถ€๋ถ„๋„ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์— ์ƒ์„ธํ•˜๊ฒŒ ์„ค๋ช…์ด ์žˆ์œผ๋‹ˆ, ์ถ”๊ฐ€๋กœ ํ•„์š”ํ•œ๊ฑด ์ฐพ์•„์„œ ์‚ฌ์šฉํ•ด๋„ ์ข‹๊ฒ ๋„ค์š” ๐Ÿง‘‍๐Ÿ’ป

 

์—ฌ๊ธฐ์„œ ํ•œ๊ฐ€์ง€, slack_url์— webhook URL์„ ์ž…๋ ฅํ•ด์ฃผ๋ฉด ๋˜๋Š”๋ฐ์š”~!

์Šฌ๋ž™์—์„œ ํŠน์ • ์ฑ„๋„์— ๋Œ€ํ•œ webhook url์€ ์–ด๋–ป๊ฒŒ ์–ป์„๊นŒ์š”~?

 

Slack ์ฑ„๋„ webhook url ๊ฐ€์ ธ์˜ค๊ธฐ

๋จผ์ € ์Šฌ๋ž™์— ๊ณต์œ ํ• , ์›ํ•˜๋Š” ์ฑ„๋„์„ ์„ ํƒํ•ด์ฃผ์„ธ์š”!

๊ทธ๋ฆฌ๊ณ  ์ƒ๋‹จ์— ํ™”์‚ดํ‘œ์—์„œ, Administration > Manage apps๋ฅผ ์„ ํƒํ•ด์ฃผ์„ธ์š”!

 

๊ทธ๋Ÿฌ๋ฉด ์Šฌ๋ž™์— ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ(?)๋“ค์ด ๋งŽ์ด ๋ณด์ด๋Š”๋ฐ, ๊ฒ€์ƒ‰์„ ํ†ตํ•ด์„œ Incoming Webhooks๋ฅผ ์„ ํƒํ•ด์ค๋‹ˆ๋‹ค.

๋ฐ”๋กœ ๋‹ค์Œ ํ™”๋ฉด์—์„œ Add to Slack ๐Ÿ‘‰

์›ํ•˜๋Š” ์Šฌ๋ž™ ์ฑ„๋„ ์„ ํƒ ๐Ÿ‘‰

์งœ์ž”~ ๊ทธ๋Ÿผ ์ด๋ ‡๊ฒŒ ๋ฐ”๋กœ webhook url์„ ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค!

๊ทธ๋ฆฌ๊ณ  ์ถ”๊ฐ€๋กœ ํ•„์š”ํ•  ๊ฒฝ์šฐ์— ์ด๋Ÿฐ ์ €๋Ÿฐ ์„ธํŒ…์„ ํ•ด์ฃผ๊ณ , ์ €์žฅํ•ด์ค๋‹ˆ๋‹ค.

 

์—ฌ๊ธฐ์„œ ๋งŒ๋“ค์–ด์ง„ WebHook URL์„ ๋ณต์‚ฌํ•ด์„œ ์•„๊นŒ ๋งŒ๋“ค๋˜ lane์˜ slack_url์— ๋„ฃ์–ด์ค๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  lane์„ ๋งŒ๋“ค์—ˆ์œผ๋‹ˆ ์‹คํ–‰ํ•ด์„œ ํ•œ๋ฒˆ ๋ฉ”์„ธ์ง€ ๋ณด๋‚ด๋ณด๊ธฐ!!

fastlane send_slack

์˜ค์˜ค์˜ท~~~ ์ž˜ ์˜ต๋‹ˆ๋‹ค!! ๐Ÿ‘

 

๊ทธ๋Ÿผ ์ด์ œ ๋งˆ์ง€๋ง‰์œผ๋กœ, ์šฐ๋ฆฌ๊ฐ€ release ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ–ˆ์„๋•Œ ์—…๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด slack์ด ์™€์•ผ๊ฒ ์ฃ ~~?

  lane :release do
    increment_build_number(xcodeproj: "PROJECT_NAME.xcodeproj")
    build_app(workspace: "PROJECT_NAME.xcworkspace", scheme: "PROJECT_NAME")
    upload_to_app_store(skip_metadata: true, skip_screenshots: true)
    send_slack
  end

์ด๋ ‡๊ฒŒ!! ์•ฑ์Šคํ† ์–ด ์—…๋กœ๋“œ์šฉ์œผ๋กœ ๋งŒ๋“ค์—ˆ๋˜ lane์˜ ๋งˆ์ง€๋ง‰์—, ๋ฐฉ๊ธˆ ๋งŒ๋“  send_slack์„ ์‹คํ–‰ํ•ด์ฃผ๊ธฐ๋งŒ ํ•˜๋ฉด ๋~~~๐Ÿ‘

 

 

** 21/04/15 ** ๋‚ด์šฉ ์ถ”๊ฐ€

์ง€๊ธˆ ์ œ๊ฐ€ ๊ฐœ๋ฐœํ•˜๋Š” ์„œ๋น„์Šค์˜ ๊ฒฝ์šฐ์—”, testflight๋กœ ๋‚ด๋ถ€ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ณ  ์•ฑ์„ ์ถœ์‹œํ•˜๋Š”๋ฐ์š”!

ํฌ์ŠคํŒ…์—์„œ๋Š” Appstore์— ์•ฑ์ด ์—…๋กœ๋“œ๋งŒ ๋˜๋ฉด ์Šฌ๋ž™์œผ๋กœ ์™„๋ฃŒ๋˜์—ˆ๋‹ค๊ณ  ๋ฉ”์„ธ์ง€๋ฅผ ๋ณด๋‚ด์ฃผ์—ˆ์–ด์š”.

 

๊ทธ์น˜๋งŒ ์‹ค์ œ๋กœ testflight์—์„œ ํ…Œ์ŠคํŠธํ•˜๋ ค๋ฉด ์•ฑ์Šคํ† ์–ด ๋‚ด๋ถ€์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ณผ์ •์ด ํ•„์š”ํ•˜๊ณ , ์ƒ๊ฐ๋ณด๋‹ค ๊ธด ์‹œ๊ฐ„์ด ์†Œ์š”๋˜์š”.

๊ทธ ์‹œ๊ฐ„๋™์•ˆ ์ณ๋‹ค๋ณด๊ณ  ์žˆ๋‹ค๊ฐ€, "์—…๋กœ๋“œ๋Š” ์•„๊นŒ ๋๋Š”๋ฐ ์ด์ œ ์ฒ˜๋ฆฌ๊ฐ€ ๋๋„ค์š”~ ํ…Œ์ŠคํŠธํ•ด์ฃผ์„ธ์š”~" ํ•  ์ˆ˜๋Š” ์—†๊ฒ ์ฃ ?ใ…‹ใ…‹

 

์œ„์—์„œ Fastfile์— ์ž‘์„ฑํ–ˆ๋˜ 

upload_to_app_store(skip_metadata: true, skip_screenshots: true)

๋ฉ”์†Œ๋“œ๋ฅผ, ํ…Œ์ŠคํŠธ ํ”Œ๋ผ์ดํŠธ๋กœ๋งŒ ๋ณ€๊ฒฝํ•ด์ฃผ๋ฉด ๋์ด์—์š”!

upload_to_testflight

์ด๋ ‡๊ฒŒ ํ•ด์ฃผ๋ฉด, ์•ฑ์Šคํ† ์–ด์—์„œ ๋‚ด๋ถ€์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ณผ์ •๊นŒ์ง€ ์™„๋ฃŒ๋˜๊ณ  ํ…Œ์ŠคํŠธ ๊ฐ€๋Šฅํ•œ ์‹œ์ ์— ์Šฌ๋ž™์„ ๋ณด๋‚ด์ค€๋‹ต๋‹ˆ๋‹ค!! ๐Ÿ‘

์ด ๊ณผ์ •์—์„œ ์•ฑ์Šคํ† ์–ด ์—…๋กœ๋“œ๋„ ๋‹น์—ฐํžˆ ํฌํ•จ๋˜๋‹ˆ๊นŒ, ์ €๋Š” ๋”ฐ๋กœ ์•ฑ์Šคํ† ์–ด ์—…๋กœ๋“œ๋Š” ์‚ฌ์šฉ์•ˆํ•ด๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”!!

 


 

์‹œ์ž‘์€ ๊ต‰์žฅํ•œ๊ฑธ ํ•˜๋Š” ๊ฒƒ ๋งˆ๋ƒฅ ์‹œ๋„ํ•œ ๊ฒƒ ๊ฐ™์€๋ฐ, ๋ง‰์ƒ ํ•ด๋†“๊ณ  ๋‚˜๋‹ˆ ๋ณ„๊ฑฐ ์—†์—ˆ๋˜ ๊ฒƒ(?) ๊ฐ™๋„ค์š”. ใ…‹ใ…‹ ๐ŸคŸ

์•ž์œผ๋กœ๋„ ์ด๊ฒƒ ์ €๊ฒƒ ์‹œ๋„ํ•˜๊ณ  ๋„์ž…ํ• ๋งŒํ•œ ๊ฑด ์ ๊ทน ์‹œ๋„ํ•ด๋ณด๊ณ  ์‹ถ๋„ค์š” ๐Ÿ˜Ž

 

์˜ค๋Š˜๋„ ๋ˆ„๊ตฐ๊ฐ€์—๊ฒŒ ๋„์›€์ด ๋˜์—ˆ๊ธธ ๋ฐ”๋ž˜์š” ๐Ÿ™

 

 

Comments