-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
225 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: bookwoori CI/CD v3 | ||
name: bookwoori Auth Service CI/CD | ||
|
||
on: | ||
push: | ||
|
@@ -37,14 +37,6 @@ jobs: | |
touch ./auth/src/main/resources/application.yml | ||
echo "${{ secrets.APPLICATION_auth }}" > ./auth/src/main/resources/application.yml | ||
- name: create-json | ||
id: create-json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "firebase-adminsdk.json" | ||
json: ${{ secrets.FIREBASE_ADMINSDK }} | ||
dir: "./auth/src/main/resources" | ||
|
||
- name: Build Auth Service with Gradle | ||
run: | | ||
cd ./auth | ||
|
@@ -76,3 +68,5 @@ jobs: | |
sudo docker ps -a --filter "name=auth" --format "{{.ID}}" | xargs -r sudo docker stop | ||
sudo docker ps -a --filter "name=auth" --format "{{.ID}}" | xargs -r sudo docker rm -f | ||
sudo docker pull ${{ secrets.DOCKER_REPO_auth }}:v2 | ||
sudo docker run -d -p 8001:8001 ${{ secrets.DOCKER_REPO_auth }}:v2 | ||
sudo docker image prune -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: bookwoori notification Service CI/CD | ||
|
||
on: | ||
push: | ||
branches: ["deploy"] | ||
paths: | ||
- "notification/**" | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy notification Service | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
# Eureka 관련 설정 삭제 | ||
- name: Remove Eureka Dependencies | ||
run: | | ||
find . -name 'build.gradle' | while read -r file; do | ||
sed -i '/spring-cloud-starter-netflix-eureka-client/d' "$file" | ||
sed -i '/spring-cloud-starter-netflix-eureka-server/d' "$file" | ||
done | ||
find . -name 'application*.yml' | while read -r file; do | ||
sed -i '/eureka:/,+3d' "$file" | ||
done | ||
- name: Make application-prod.yml | ||
run: | | ||
mkdir -p ./notification/src/main/resources | ||
touch ./notification/src/main/resources/application.yml | ||
echo "${{ secrets.APPLICATION_notification }}" > ./notification/src/main/resources/application.yml | ||
- name: Build notification Service with Gradle | ||
run: | | ||
cd ./notification | ||
chmod +x ./gradlew | ||
./gradlew clean build -x test --no-daemon | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Docker Build and Push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./notification | ||
file: ./notification/Dockerfile | ||
platforms: linux/arm64/v8 | ||
push: true | ||
tags: ${{ secrets.DOCKER_REPO_notification }}:v2 | ||
|
||
- name: Deploy to Server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
sudo docker ps -a --filter "name=notification-app" --format "{{.ID}}" | xargs -r sudo docker stop | ||
sudo docker ps -a --filter "name=notification-app" --format "{{.ID}}" | xargs -r sudo docker rm -f | ||
sudo docker pull ${{ secrets.DOCKER_REPO_notification }}:v2 | ||
sudo docker run -d -p 8082:8082 ${{ secrets.DOCKER_REPO_notification }}:v2 | ||
sudo docker image prune -f | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: bookwoori Chat Service CI/CD | ||
|
||
on: | ||
push: | ||
branches: ["deploy"] | ||
paths: | ||
- "chat/**" | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy chat Service | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
# Eureka 관련 설정 삭제 | ||
- name: Remove Eureka Dependencies | ||
run: | | ||
find . -name 'build.gradle' | while read -r file; do | ||
sed -i '/spring-cloud-starter-netflix-eureka-client/d' "$file" | ||
sed -i '/spring-cloud-starter-netflix-eureka-server/d' "$file" | ||
done | ||
find . -name 'application*.yml' | while read -r file; do | ||
sed -i '/eureka:/,+3d' "$file" | ||
done | ||
- name: Make application-prod.yml | ||
run: | | ||
mkdir -p ./chat/src/main/resources | ||
touch ./chat/src/main/resources/application.yml | ||
echo "${{ secrets.APPLICATION_chat }}" > ./chat/src/main/resources/application.yml | ||
- name: Build chat Service with Gradle | ||
run: | | ||
cd ./chat | ||
chmod +x ./gradlew | ||
./gradlew clean build -x test --no-daemon | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Docker Build and Push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./chat | ||
file: ./chat/Dockerfile | ||
platforms: linux/arm64/v8 | ||
push: true | ||
tags: ${{ secrets.DOCKER_REPO_chat }}:v2 | ||
|
||
- name: Deploy to Server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
sudo docker ps -a --filter "name=chat" --format "{{.ID}}" | xargs -r sudo docker stop | ||
sudo docker ps -a --filter "name=chat" --format "{{.ID}}" | xargs -r sudo docker rm -f | ||
sudo docker pull ${{ secrets.DOCKER_REPO_chat }}:v2 | ||
sudo docker run -d -p 8081:8081 ${{ secrets.DOCKER_REPO_chat }}:v2 | ||
sudo docker image prune -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: bookwoori Gateway Service CI/CD | ||
|
||
on: | ||
push: | ||
branches: ["deploy"] | ||
paths: | ||
- "gateway/**" | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy gateway Service | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
# Eureka 관련 설정 삭제 | ||
- name: Remove Eureka Dependencies | ||
run: | | ||
find . -name 'build.gradle' | while read -r file; do | ||
sed -i '/spring-cloud-starter-netflix-eureka-client/d' "$file" | ||
sed -i '/spring-cloud-starter-netflix-eureka-server/d' "$file" | ||
done | ||
find . -name 'application*.yml' | while read -r file; do | ||
sed -i '/eureka:/,+3d' "$file" | ||
done | ||
- name: Make application-prod.yml | ||
run: | | ||
mkdir -p ./gateway/src/main/resources | ||
touch ./gateway/src/main/resources/application.yml | ||
echo "${{ secrets.APPLICATION_gateway }}" > ./gateway/src/main/resources/application.yml | ||
- name: Build gateway Service with Gradle | ||
run: | | ||
cd ./gateway | ||
chmod +x ./gradlew | ||
./gradlew clean build -x test --no-daemon | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Docker Build and Push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./gateway | ||
file: ./gateway/Dockerfile | ||
platforms: linux/arm64/v8 | ||
push: true | ||
tags: ${{ secrets.DOCKER_REPO_gateway }}:v2 | ||
|
||
- name: Deploy to Server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
sudo docker ps -a --filter "name=gateway" --format "{{.ID}}" | xargs -r sudo docker stop | ||
sudo docker ps -a --filter "name=gateway" --format "{{.ID}}" | xargs -r sudo docker rm -f | ||
sudo docker pull ${{ secrets.DOCKER_REPO_gateway }}:v2 | ||
sudo docker run -d -p 8000:8000 ${{ secrets.DOCKER_REPO_gateway }}:v2 | ||
sudo docker image prune -f |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters