[VVUE] CI/CD ๋ฐฐํฌ ํ์ดํ๋ผ์ธ ์์
Github์ผ๋ก ๋ ํฌ์งํ ๋ฆฌ๋ฅผ ์ฎ๊ธฐ๊ณ , Github Actions๋ฅผ ์ฌ์ฉํ๊ธฐ๋ก ํจ
Gitlab(Webhook) => Jenkins => AWS EC2 (๋ด๋ถ์์ Docker Image ์์ฑ & Run)
์ฅ์ )
1. Docker Hub์ ์์กดํ์ง ์์๋ ๋๋ค.
๋จ์ )
1. ๋ณต์กํ๋ค
2. ๋์ด ์๋ค
- Github Action -
https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
Understanding GitHub Actions - GitHub Docs
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged
docs.github.com
- AWS S3 ๋ฅผ ๋์ปค ๋ ์ง์คํธ๋ฆฌ๋ก ๊ตฌ์ถํด์ ์ฌ์ฉํ๊ธฐ -
PYRASIS.COM: ์ด์ฌํ์ ์ธ์ ๋ ์ต์ Docker - Unit 6. Docker ์ข๋ ํ์ฉํ๊ธฐ
์ ์๊ถ ์๋ด ์ฑ ๋๋ ์น์ฌ์ดํธ์ ๋ด์ฉ์ ๋ณต์ ํ์ฌ ๋ค๋ฅธ ๊ณณ์ ๊ฒ์ํ๋ ๊ฒ์ ๊ธ์งํฉ๋๋ค.์ฑ ๋๋ ์น์ฌ์ดํธ์ ๋ด์ฉ์ ๋ฐ์ท, ์์ฝํ์ฌ ๊ฐ์ ์๋ฃ, ๋ฐํ ์๋ฃ, ๋ธ๋ก๊ทธ ํฌ์คํ ๋ฑ์ผ๋ก ๋ง๋๋ ๊ฒ์ ๊ธ
pyrasis.com
- Github Actions + AWS S3 + AWS Code Deploy + AWS EC2 -
https://dkswnkk.tistory.com/674
Spring Boot + GitHub Actions + AWS CodeDeploy๋ฅผ ํ์ฉํ CI/CD ๊ตฌ์ถ
์๋ก ์ง๊ธ๊น์ง ๋งค๋ฒ ํ๋ก์ ํธ๋ฅผ ๊ตฌ์ถํ ๋๋ง๋ค ์ด์ ์ฝ๋๋ค์ ๋ฒ๊ฑฐ๋กญ๊ฒ ๋ด๊ฐ๋ฉด์ CI/CD๋ฅผ ๊ตฌ์ถํ์๋๋ฐ, ์ด๋ฒ ๊ธฐํ์ ํ๋ฒ ๋ฌธ์ํ๋ฅผ ํด๋ณด๊ณ ์ ๊ธ์ ์์ฑํ๊ฒ ๋์์ต๋๋ค. [CI/CD] CI/CD๋?, ์ง์์
dkswnkk.tistory.com
์ฅ์ )
1. Docker Hub์ผ๋ก ๊ฐํธํ๊ฒ ๊ตฌ์ถํ ์ ์๋ค
2. (๋์๊ฒ๋) ๋ฌด๋ฃ๋ค
๋จ์ )
1. Public Repo ..
2. Docker Hub์ ์์กดํ๋ค
Settings -> Secrets and variables -> Actions
DOCKERHUB_PASSWORD : ๋ณธ์ธ์ Docker Hub Username
DOCKERHUB_USERNAME : ๋ณธ์ธ์ Docker Hub Password
EC2_HOST : AWS EC2 ์ธ์คํด์ค์ ํผ๋ธ๋ฆญ IPv4 DNS
EC2_KEY : AWS EC2 ์ธ์คํด์ค๋ฅผ ์์ฑํ ๋ ์ ์ฅ๋ pem ํค
EC2_PORT :
EC2_USERNAME : ubuntu
ENV_PATH : .env ํ์ผ ๊ฒฝ๋ก
SERVER_PORT : ํด๋น ์๋ฒ ๋์๊ฐ๋ ํฌํธ
FROM openjdk:17
ARG IDLE_PROFILE
ARG JAR_FILE=build/libs/*.jar
ENV ENV_IDLE_PROFILE=$IDLE_PROFILE
COPY ${JAR_FILE} app.jar
RUN echo $ENV_IDLE_PROFILE
ENTRYPOINT ["java", "-Dspring.profiles.active=${ENV_IDLE_PROFILE}", "-jar","/app.jar"]
IDLE_PROFILE์ ๋ฌด์ค๋จ ๋ฐฐํฌ ์๋ํ๋๋ด ์์
1) ์๋ก ๋ค๋ฅธ job๊ฐ์ ํ๊ฒฝ์ด ๊ณต์ ๋์ง ์์์ ๊ฐ๊ณผํ๊ณ , ์ฝ๋๋ฅผ ์์ฑํ์ฌ ์ค๋ฅ๋จ
- ls ๋ก checkout ํด์จ code์ ์กด์ฌ ์ฌ๋ถ๋ฅผ ํ์ธํ๋๋ ์์ > ์๋ชป ๋์์์ ๊นจ๋ฌ์
2) ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
[ ๋๊ฐ์ ์๋ฌ ]
https://github.com/marketplace/actions/ssh-remote-commands#if-you-are-using-openssh
SSH Remote Commands - GitHub Marketplace
Executing remote ssh commands
github.com
[ํด๊ฒฐ ๋ฐฉ์]
https://github.com/appleboy/ssh-action#setting-up-a-ssh-key
GitHub - appleboy/ssh-action: GitHub Actions for executing remote ssh commands.
GitHub Actions for executing remote ssh commands. Contribute to appleboy/ssh-action development by creating an account on GitHub.
github.com
// workflow ๋ถ์ฌ๋ฃ๊ธฐ
[ ์ ์ฒด์ ์ธ ๋ก์ง ]
https://chb2005.tistory.com/191
[CI/CD] Github Actions๋ฅผ ํ์ฉํ CI/CD ํ์ดํ๋ผ์ธ ๊ตฌ์ถ (+ Docker hub)
Github Actions๋ฅผ ํ์ฉํ CI/CD ํ์ดํ๋ผ์ธ ๊ตฌ์ถ ๊ฐ๋ EC2 Instance ์์ฑ, EC2 Instance์ Docker ์ค์น, Docker Hub ํ์๊ฐ์ ์ด ๋์ด์๋ค๊ณ ๊ฐ์ Github Repository์ ํ๋ก์ ํธ์ ์ถ๊ฐ์ฌํญ์ด๋ ๋ณ๊ฒฝ์ฌํญ push ํน์ merge Git
chb2005.tistory.com
[ IDLE_PROFILE / ๋ฌด์ค๋จ ๋ฐฐํฌ ]
Docker๋ก Spring ์ ํ๋ฆฌ์ผ์ด์ ๋ฐฐํฌํ๊ธฐ
์ด์ ์ ๊ตฌ์ถํ๋ ๋ฌด์ค๋จ ๋ฐฐํฌ ํ๋ก์ ํธ์ Docker๋ฅผ ์ ์ฉํ๋ ค๊ณ ํ๋ค. ์ต์ข ์ ์ธ ์ํคํ ์ณ ๋ชจ์ต์ ๋ค์๊ณผ ๊ฐ๋ค. Dockerfile๊ณผ ๋ฐฐํฌ Script๋ ์๋ ์ ์ฅ์๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์ GitHub - 92SooJong/Toy-Project-Board Contri
soojong.tistory.com
| [5์ผ์ ๊ธฐ์ : ๋ ธํ์ฐ ๊ณต์ ์ปค๋ฎค๋ํฐ] (2) ERD ์ค๊ณ (0) | 2023.12.22 |
|---|---|
| [5์ผ์ ๊ธฐ์ : ๋ ธํ์ฐ ๊ณต์ ์ปค๋ฎค๋ํฐ] (1) ๊ธฐํ & ํ๋ฉด ์ค๊ณ (0) | 2023.12.22 |
| [One-pick] ์๋ฒ ์ค์ (3) - NGINX : /api ๋ 8080ํฌํธ๋ก! (0) | 2023.09.24 |
| [One-pick] ์๋ฒ ์ค์ (2) - SSL ์ค์ (0) | 2023.09.23 |
| [One-pick] ์๋ฒ ์ค์ (1) - ๊ฐ๋น์ ๋๋ฉ์ธ ๊ตฌ์ + DNS ๋ ์ฝ๋ ์ถ๊ฐ (0) | 2023.09.23 |