Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] set new CD #25

Conversation

drbug2000
Copy link
Collaborator

add ignore application-dev
add "deploy" branch work CD
fix set application file process

๐Ÿ“ ์š”์•ฝ

๋‹ค์‹œ ๋ฐฐํฌ ํ™˜๊ฒฝ ์„ค์ •

  1. "deploy" branch์— PR์„ ์š”์ฒญํ•  ์‹œ, deploy job์ด ์‹คํ–‰ ๋ฉ๋‹ˆ๋‹ค.

    • ci/cd ํ™˜๊ฒฝ ์ˆ˜์ • ์‹œ PR์„ 2๋ฒˆ ์Šน์ธ ๋ฐ›์•„์•ผ EC2์— ๋ฐฐํฌ๊ฐ€ ์ž˜ ์ด๋ฃจ์–ด์ง€๋Š”์ง€ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
    • ๋ฐฐํฌ ํ™•์ธ์šฉ "deploy" branch๋ฅผ ์ƒ์„ฑํ•ด ์ด ๋ธŒ๋žœ์น˜์— PR์„ ๋ณด๋‚ด๋ฉด, ๋ฐฐํฌ๊ฐ€ ์ด๋ฃจ์–ด ์ง€๋„๋ก ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
  2. gitignore์— application-dev.yml ์ถ”๊ฐ€

    • ์•ž์œผ๋กœ๋Š” ๋ฐฐํฌ์šฉ application.yml ํŒŒ์ผ ๋‚ด์šฉ ์ „์ฒด๊ฐ€ base64 ๋ฐฉ์‹์œผ๋กœ encoding ๋˜์–ด ์ž…๋ ฅ๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
    • ๋”ฐ๋ผ์„œ ๋ฐฐํฌ์šฉ application ํŒŒ์ผ์ธ -dev.yml์„ ignore๋กœ ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ๋”ฐ๋ผ์„œ ํ˜„์žฌ ํŒŒ์ผ์— ์žˆ๋Š” application.yml ๋ฐฐํฌ ๊ณผ์ •์—์„œ ์“ฐ์ด๋Š” ์•Š์Šต๋‹ˆ๋‹ค._ (์•„์˜ˆ ๋‚ด์šฉ์ด ์ƒˆ๋กœ ์“ฐ์ž„)
  3. gradle.yml deploy ๊ณผ์ • ์ˆ˜์ •

  • git secret์—์„œ base64๋กœ ์ธ์ฝ”๋”ฉ๋œ application.yml ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€ ๋””์ฝ”๋”ฉํ•œ ํ›„ appliction.yml๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์ด์Šˆ ๋ฒˆํ˜ธ : #11

๐Ÿ”– ๋ณ€๊ฒฝ ์‚ฌํ•ญ

์•ž์œผ๋กœ application.yml ํŒŒ์ผ ๊ด€๋ฆฌ

  • application-dev๋Š” CI/CD ๋‹ด๋‹น์ž๋งŒ ๊ด€๋ฆฌํ•˜๋ฉด ๋˜๋ฏ€๋กœ ์‹ ๊ฒฝ ์“ฐ์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค.
  • application.yml์— ์ถ”๊ฐ€ํ•ด์•ผ ํ•  ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋‚˜ ์†์„ฑ์ด ์žˆ์œผ๋ฉด CI/CD ๋‹ด๋‹น์žํ•œํ…Œ ๋งํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • application-local.yml์— local ๊ฐœ๋ฐœ์šฉ application ์„ค์ •์€ ๊ธฐ์กด์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • application.yml ์˜ active profile์˜ default ์„ค์ •์ด "dev" ์—์„œ "local"๋กœ ๋ณ€๊ฒฝ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ ๋”ฐ๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์ฃผ์ž…ํ•˜์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค.

โœ… ๋ฆฌ๋ทฐ ์š”๊ตฌ์‚ฌํ•ญ

๐Ÿ“ธ ํ™•์ธ ๋ฐฉ๋ฒ• (์„ ํƒ)

add ignore application-dev
add "deploy" branch work CD
fix set application file process
add "deploy" branch
@drbug2000 drbug2000 closed this Jul 18, 2024
@hyunn522 hyunn522 deleted the chore/#11/applicationyml-ํŒŒ์ผ-์ˆ˜์ •-ํ™˜๊ฒฝ-๋ณ€์ˆ˜-์„ค์ • branch July 25, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant