-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from Modagbul/develop
fix: 소모임 가입할 때 소모임 삭제 여부 확인
- Loading branch information
Showing
8 changed files
with
195 additions
and
114 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
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 |
---|---|---|
@@ -1,114 +1,114 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ./ | ||
APPLICATION: ${{ secrets.APPLICATION }} | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
APPLE_KEY: ${{ secrets.APPLE_KEY }} | ||
|
||
steps: | ||
# 소스 코드 체크아웃 | ||
- uses: actions/checkout@v2 | ||
|
||
# JDK 11 설정 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
# Gradle 패키지 캐시 | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# 설정 파일 생성 | ||
- run: | | ||
mkdir ./src/main/resources | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
echo "${{env.APPLICATION}}" > ./application.yml | ||
touch ./firebase-key.json | ||
echo "${{env.GOOGLE_APPLICATION_CREDENTIALS}}" | base64 --decode > ./firebase-key.json | ||
touch ./apple-key.p8 | ||
echo "${{env.APPLE_KEY}}" > ./apple-key.p8 | ||
# 설정 파일을 작업공간에 저장 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: application.yml | ||
path: ./src/main/resources/application.yml | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: firebase-key.json | ||
path: ./src/main/resources/firebase-key.json | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: apple-key.p8 | ||
path: ./src/main/resources/apple-key.p8 | ||
|
||
# gradlew 권한 설정 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
working-directory: ${{ env.working-directory }} | ||
|
||
# Gradle로 빌드 | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
working-directory: ${{ env.working-directory }} | ||
|
||
# Gradle 캐시 정리 | ||
- name: Cleanup Gradle Cache | ||
if: ${{ always() }} | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
# Docker 이미지 빌드 및 푸시 | ||
- name: Docker build | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build --no-cache -t ${{ secrets.DOCKER_USERNAME }}/moing:green . | ||
docker build --no-cache -t ${{ secrets.DOCKER_USERNAME }}/moing:blue . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/moing:green | ||
docker push ${{ secrets.DOCKER_USERNAME }}/moing:blue | ||
# EC2로 deploy.sh 전송 | ||
- name: Deploy deploy.sh to EC2 | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.EC2_SERVER_HOST }} | ||
username: ec2-user | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
source: "./deploy.sh" | ||
target: "/home/ec2-user/" | ||
|
||
# 배포 스크립트 실행 | ||
- name: Deploy on EC2 | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.EC2_SERVER_HOST }} | ||
username: ec2-user | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
envs: GITHUB_SHA | ||
script: | | ||
chmod +x /home/ec2-user/deploy.sh | ||
/home/ec2-user/deploy.sh | ||
#name: CI/CD | ||
# | ||
#on: | ||
# push: | ||
# branches: [ "main" ] | ||
# | ||
#permissions: | ||
# contents: read | ||
# | ||
#jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# working-directory: ./ | ||
# APPLICATION: ${{ secrets.APPLICATION }} | ||
# GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
# APPLE_KEY: ${{ secrets.APPLE_KEY }} | ||
# | ||
# steps: | ||
# # 소스 코드 체크아웃 | ||
# - uses: actions/checkout@v2 | ||
# | ||
# # JDK 11 설정 | ||
# - name: Set up JDK 11 | ||
# uses: actions/setup-java@v2 | ||
# with: | ||
# java-version: '11' | ||
# distribution: 'adopt' | ||
# | ||
# # Gradle 패키지 캐시 | ||
# - name: Cache Gradle packages | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
# | ||
# # 설정 파일 생성 | ||
# - run: | | ||
# mkdir ./src/main/resources | ||
# cd ./src/main/resources | ||
# touch ./application.yml | ||
# echo "${{env.APPLICATION}}" > ./application.yml | ||
# touch ./firebase-key.json | ||
# echo "${{env.GOOGLE_APPLICATION_CREDENTIALS}}" | base64 --decode > ./firebase-key.json | ||
# touch ./apple-key.p8 | ||
# echo "${{env.APPLE_KEY}}" > ./apple-key.p8 | ||
# | ||
# # 설정 파일을 작업공간에 저장 | ||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: application.yml | ||
# path: ./src/main/resources/application.yml | ||
# | ||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: firebase-key.json | ||
# path: ./src/main/resources/firebase-key.json | ||
# | ||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: apple-key.p8 | ||
# path: ./src/main/resources/apple-key.p8 | ||
# | ||
# # gradlew 권한 설정 | ||
# - name: Grant execute permission for gradlew | ||
# run: chmod +x gradlew | ||
# working-directory: ${{ env.working-directory }} | ||
# | ||
# # Gradle로 빌드 | ||
# - name: Build with Gradle | ||
# run: ./gradlew build | ||
# working-directory: ${{ env.working-directory }} | ||
# | ||
# # Gradle 캐시 정리 | ||
# - name: Cleanup Gradle Cache | ||
# if: ${{ always() }} | ||
# run: | | ||
# rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
# rm -f ~/.gradle/caches/modules-2/gc.properties | ||
# | ||
# # Docker 이미지 빌드 및 푸시 | ||
# - name: Docker build | ||
# run: | | ||
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
# docker build --no-cache -t ${{ secrets.DOCKER_USERNAME }}/moing:green . | ||
# docker build --no-cache -t ${{ secrets.DOCKER_USERNAME }}/moing:blue . | ||
# docker push ${{ secrets.DOCKER_USERNAME }}/moing:green | ||
# docker push ${{ secrets.DOCKER_USERNAME }}/moing:blue | ||
# | ||
# # EC2로 deploy.sh 전송 | ||
# - name: Deploy deploy.sh to EC2 | ||
# uses: appleboy/scp-action@master | ||
# with: | ||
# host: ${{ secrets.EC2_SERVER_HOST }} | ||
# username: ec2-user | ||
# key: ${{ secrets.PRIVATE_KEY }} | ||
# source: "./deploy.sh" | ||
# target: "/home/ec2-user/" | ||
# | ||
# # 배포 스크립트 실행 | ||
# - name: Deploy on EC2 | ||
# uses: appleboy/ssh-action@master | ||
# with: | ||
# host: ${{ secrets.EC2_SERVER_HOST }} | ||
# username: ec2-user | ||
# key: ${{ secrets.PRIVATE_KEY }} | ||
# envs: GITHUB_SHA | ||
# script: | | ||
# chmod +x /home/ec2-user/deploy.sh | ||
# /home/ec2-user/deploy.sh |
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 |
---|---|---|
|
@@ -103,6 +103,10 @@ | |
| 소모임을 가입할 때 | ||
| 소모임을 이미 가입함 | ||
|
||
| `T0005` | ||
| 소모임을 가입할 때 | ||
| 소모임이 삭제됨 | ||
|
||
|=== | ||
|
||
=== MyPage ErrorCode | ||
|
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/moing/backend/domain/team/exception/DeletedTeamException.java
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,11 @@ | ||
package com.moing.backend.domain.team.exception; | ||
|
||
import com.moing.backend.global.response.ErrorCode; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public class DeletedTeamException extends TeamException{ | ||
public DeletedTeamException(){ | ||
super(ErrorCode.DELETED_TEAM_ERROR, | ||
HttpStatus.NOT_FOUND); | ||
} | ||
} |
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