Skip to content

Commit bedc5b0

Browse files
authored
Merge pull request #144 from team-gogo/develop
v2025.4.4
2 parents 0b46b09 + 6167a6a commit bedc5b0

File tree

4 files changed

+92
-6
lines changed

4 files changed

+92
-6
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: GOGO Stage On-premise stage CD Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
workflow_dispatch:
8+
9+
jobs:
10+
CI:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: gradle
23+
24+
- name: Setup Gradle
25+
uses: gradle/gradle-build-action@v2
26+
27+
- name: Setup Gradle's permission
28+
run: chmod +x gradlew
29+
30+
- name: Build with Gradle
31+
run: ./gradlew clean build
32+
33+
deploy:
34+
needs: CI
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
- name: Install sshpass and OpenSSH
41+
run: |
42+
sudo apt-get update && sudo apt-get install -y sshpass openssh-client
43+
44+
- name: SSH Command to Deploy using Bastion and Target Instance
45+
run: |
46+
sshpass -p "${{ secrets.STAGE_ON_PREMISE_PASSWORD }}" ssh -o StrictHostKeyChecking=no ubuntu@${{ secrets.STAGE_ON_PREMISE_HOST }} << 'EOF'
47+
mkdir -p /home/ubuntu/gogo-stage
48+
cd /home/ubuntu/gogo-stage
49+
50+
if [ ! -d ".git" ]; then
51+
git clone -b develop https://github.com/team-gogo/gogo-stage.git .
52+
else
53+
git pull origin develop
54+
fi
55+
56+
./gradlew clean build
57+
58+
docker build -f DockerFileStage -t gogo-stage-stage .
59+
60+
docker stop gogo-stage-stage || true
61+
docker rm gogo-stage-stage || true
62+
63+
docker run -d -p 8082:8082 --add-host host.docker.internal:host-gateway --name gogo-stage-stage gogo-stage-stage
64+
65+
- name: SSH Success Notification
66+
if: success()
67+
uses: sarisia/actions-status-discord@v1
68+
with:
69+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
70+
color: 0x4CAF50
71+
title: "배포 성공"
72+
message: "GOGO Stage On-premise stage deployment completed successfully."
73+
74+
- name: SSH Failure Notification
75+
if: failure()
76+
uses: sarisia/actions-status-discord@v1
77+
with:
78+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
79+
color: 0xFF4C4C
80+
title: "배포 실패"
81+
message: "GOGO Stage On-premise stage deployment failed. Check the logs for details."

.github/workflows/gogo-stage-stage-cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: GOGO Stage stage CD Workflow
22

3-
on:
4-
push:
5-
branches:
6-
- 'develop'
7-
workflow_dispatch:
3+
#on:
4+
# push:
5+
# branches:
6+
# - 'develop'
7+
# workflow_dispatch:
88

99
jobs:
1010
CI:

src/main/kotlin/gogo/gogostage/domain/team/root/application/TeamServiceImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class TeamServiceImpl(
3131
val student = userUtil.getCurrentStudent()
3232
val game = gameReader.read(gameId)
3333
teamValidator.validApply(student, game, dto)
34-
3534
teamProcessor.apply(game, dto)
3635
}
3736

src/main/kotlin/gogo/gogostage/domain/team/root/application/TeamValidator.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ class TeamValidator(
1818
) {
1919

2020
fun validApply(student: StudentByIdStub, game: Game, dto: TeamApplyDto) {
21+
22+
val maxTeamNameLength = 6
23+
if (dto.teamName.length > maxTeamNameLength) {
24+
throw StageException("팀 이름은 ${maxTeamNameLength}글자를 넘을 수 없습니다.", HttpStatus.BAD_REQUEST.value())
25+
}
26+
2127
val isParticipant = stageParticipantRepository.existsByStageIdAndStudentId(
2228
stageId = game.stage.id,
2329
studentId = student.studentId

0 commit comments

Comments
 (0)