-
Notifications
You must be signed in to change notification settings - Fork 2
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
π[CI/CD] Create gradle.yml #3 #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ³ μνμ ¨μ΅λλ€!
.github/workflows/gradle.yml
Outdated
|
||
# Docker μ΄λ―Έμ§ Build (2) | ||
- name: docker image build | ||
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/sponus-docker --pull --no-cache . #imageλͺ κΈ°μ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--platform linux/amd64 μ΅μ μ μ€μ λΉλνλ©΄ OS μ’ μμ±μ μ κ±°ν μ μμ΅λλ€!
.github/workflows/gradle.yml
Outdated
run: | | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κΈ°μ‘΄μ λ
env:
spring.datasource.url: ${{ secrets.DB_URL }}
...
μ΄λ°μμΌλ‘ νκ²½λ³μλ₯Ό μ€μ νλλ°, μ΄ λ°©λ²λ κΉλνλ μ’λ€μ!
λ°°μκ°λλ€~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ³ μνμ ¨μ΅λλ€! μΉμΈν΄λκ² μ΅λλ€!~~
.github/workflows/gradle.yml
Outdated
#redis | ||
sudo docker stop my-redis | ||
sudo docker rm my-redis | ||
sudo docker rmi redis | ||
|
||
sudo docker pull redis | ||
sudo docker network create my-network | ||
sudo docker run --name my-redis --network my-network -d redis | ||
sudo docker run -it -d -p 8080:8080 --name sponus-docker -e TZ=Asia/Seoul --network my-network ${{ secrets.DOCKER_USERNAME }}/sponus-docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis μΈν κΉμ§ ν΄μ£Όμ ¨λ€μ. κ°μ¬ν©λλ€!!
.github/workflows/gradle.yml
Outdated
@@ -0,0 +1,72 @@ | |||
name: Java CI with Gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ°°ν¬κΉμ§ μ§ννλ―λ‘ CI/CDλΌκ³ λͺ νν μμ±ν΄λ μ’μ κ² κ°μ΅λλ€!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ν κ°μ§ μΆκ° μ견μ λ¨κΈ°μλ©΄, CIμ CDλ₯Ό ꡬλΆν΄μ μμ±νλ κ²μ μ΄λ¨κΉμ??
CI(gradle build)λ PRμ μ¬λ¦΄ λ μ€νλλλ‘νκ³ ,
CD(ec2 λ°°ν¬)λ develop λΈλμΉμ mergeλμμ λ μ€νλλλ‘ ν΄λ μ’μ κ² κ°μμ!
λ€λ₯Έ νλ‘μ νΈμμ PRμ Gradle buildκ° ν΅κ³ΌλΌμΌλ§ main λΈλμΉμ λ¨Έμ§ ν μ μλλ‘ νμλλ°,
λ³ν© μ μ λ¬Έμ κ° μλμ§ PRμμ μ§κ΄μ μΌλ‘ νμΈν μ μμ΄ μ’μλ κ² κ°μμ!
νΈλ¦¬κ±° μμ
on:
pull_request:
branches: [ "develop" ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ°μ¬ν©λλ€! μμ νκ² μ΅λλ€~ ππ
run: | | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ λ°©μμΌλ‘ ymlμ κ΄λ¦¬νλ€λ©΄, κΈ°μ‘΄μ μ κ° μμ±ν΄ λμ
application-local.yml
application-prod.yml
μ μμ νκ³ , application.yml
μ application-local.yml
μ 볡λΆν΄μ λ¨κ²¨λμλ λ κ² κ°μμ! μμ λΆνλ립λλ€ π
π Key Changes
π To Reviewers