Skip to content

Commit

Permalink
v2.0.0 (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 authored Aug 1, 2024
2 parents 08471b7 + 344a535 commit 576419f
Show file tree
Hide file tree
Showing 263 changed files with 9,500 additions and 1,008 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/develop_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build and Deploy to Develop

on:
push:
branches: ["develop"]
branches:
- develop

permissions:
id-token: write
Expand Down Expand Up @@ -40,19 +41,19 @@ jobs:
run: docker-compose -f ./docker-compose-test.yaml up -d

# Gradle 빌드
- name: Build with Gradle
id: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: |
build
--configuration-cache
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} # feature 브랜치는 캐시를 읽기 전용으로 설정
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
add-job-summary-as-pr-comment: always
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"

- name: Build with Gradle
id: gradle
run: ./gradlew build --configuration-cache

# Dockerhub 로그인
- name: Login to Dockerhub
Expand Down Expand Up @@ -98,19 +99,6 @@ jobs:
- name: Copy docker-compose file to S3
run: aws s3 cp docker-compose.yml ${{ env.S3_COPY_PATH }}

# 디스코드 둘기봇으로 gradle build scan 결과 발송
- name: Send Gradle Build Scan Result to Discord
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]
# EC2로 배포
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
Expand All @@ -128,3 +116,15 @@ jobs:
docker pull ${{ env.IMAGE_FULL_URL }}
docker compose up -d
docker image prune -a -f
# Slack 알림
- name: Send Deploy Result to Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 둘기봇
SLACK_ICON: https://github.com/GDSC-Hongik/gdsc-server/assets/91878695/1d3861bd-672d-4ee7-8de4-f06c9a06f514
SLACK_TITLE: "Deploy Summary - Develop"
SLACK_MESSAGE: |
- image tag: `${{ steps.metadata.outputs.tags }}`
- build scan report: ${{ steps.gradle.outputs.build-scan-url }}
13 changes: 12 additions & 1 deletion .github/workflows/develop_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
deploy:
runs-on: ubuntu-latest
environment: develop
env:
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.commit_hash }}
steps:
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.commit_hash }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
Expand All @@ -27,3 +28,13 @@ jobs:
docker pull ${{ env.IMAGE_FULL_URL }}
docker compose up -d
docker image prune -a -f
# Slack 알림
- name: Send Deploy Result to Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 둘기봇
SLACK_ICON: https://github.com/GDSC-Hongik/gdsc-server/assets/91878695/1d3861bd-672d-4ee7-8de4-f06c9a06f514
SLACK_TITLE: "Deploy Summary - Develop"
SLACK_MESSAGE: Manually deployed with `${{ env.IMAGE_FULL_URL }}`
39 changes: 19 additions & 20 deletions .github/workflows/production_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:
run: docker-compose -f ./docker-compose-test.yaml up -d

# Gradle 빌드
- name: Build with Gradle
id: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: |
build
--configuration-cache
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} # feature 브랜치는 캐시를 읽기 전용으로 설정
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
add-job-summary-as-pr-comment: always
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"

- name: Build with Gradle
id: gradle
run: ./gradlew build --configuration-cache

# Dockerhub 로그인
- name: Login to Dockerhub
Expand Down Expand Up @@ -114,19 +114,6 @@ jobs:
- name: Copy docker-compose file to S3
run: aws s3 cp docker-compose.yml ${{ env.S3_COPY_PATH }}

# 디스코드 둘기봇으로 gradle build scan 결과 발송
- name: Send Gradle Build Scan Result to Discord
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
env:
Expand All @@ -143,3 +130,15 @@ jobs:
docker pull ${{ env.IMAGE_FULL_URL }}
docker-compose up -d
docker image prune -a -f
# Slack 알림
- name: Send Deploy Result to Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 둘기봇
SLACK_ICON: https://github.com/GDSC-Hongik/gdsc-server/assets/91878695/1d3861bd-672d-4ee7-8de4-f06c9a06f514
SLACK_TITLE: "Deploy Summary - Production"
SLACK_MESSAGE: |
- image tag: `${{ steps.metadata.outputs.tags }}`
- build scan report: ${{ steps.gradle.outputs.build-scan-url }}
13 changes: 12 additions & 1 deletion .github/workflows/production_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
deploy:
runs-on: ubuntu-latest
environment: production
env:
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.semver }}
steps:
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.semver }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
Expand All @@ -27,3 +28,13 @@ jobs:
docker pull ${{ env.IMAGE_FULL_URL }}
docker-compose up -d
docker image prune -a -f
# Slack 알림
- name: Send Deploy Result to Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 둘기봇
SLACK_ICON: https://github.com/GDSC-Hongik/gdsc-server/assets/91878695/1d3861bd-672d-4ee7-8de4-f06c9a06f514
SLACK_TITLE: "Deploy Summary - Production"
SLACK_MESSAGE: Manually deployed with `${{ env.IMAGE_FULL_URL }}`
12 changes: 6 additions & 6 deletions .github/workflows/pull_request_gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
- name: Start containers
run: docker-compose -f ./docker-compose-test.yaml up -d

- name: Build with Gradle
- name: Setup Gradle
id: gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: |
check
--configuration-cache
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} # feature 브랜치는 캐시를 읽기 전용으로 설정
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
add-job-summary-as-pr-comment: always
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"

- name: Check with Gradle
run: ./gradlew check --configuration-cache
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ bin/
out/
!**/src/main/**/out/
!**/src/test/**/out/
/src/main/generated/
/src/test/generated_tests/

### NetBeans ###
/nbproject/private/
Expand All @@ -41,3 +43,4 @@ out/

### Secrets ###
.env
.env.*
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ ext {
set('snippetsDir', file("build/generated-snippets"))
}

dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2023.0.2'
}
}


dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
Expand All @@ -53,10 +60,11 @@ dependencies {

// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
testImplementation 'org.testcontainers:testcontainers'

// Querydsl
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
implementation 'com.querydsl:querydsl-jpa:5.1.0:jakarta'
annotationProcessor 'com.querydsl:querydsl-apt:5.1.0:jakarta'
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

Expand All @@ -80,6 +88,11 @@ dependencies {

// Monitoring
implementation 'io.micrometer:micrometer-registry-prometheus'

// OpenFeign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'io.github.openfeign:feign-jackson'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import lombok.Getter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.domain.AbstractAggregateRoot;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseTimeEntity {
public abstract class BaseEntity extends AbstractAggregateRoot<BaseEntity> {

@Column(updatable = false)
@CreatedDate
private LocalDateTime createdAt;

@Column
@LastModifiedDate
private LocalDateTime updatedAt;

@Column(updatable = false)
@CreatedBy
private Long createdBy;

@LastModifiedBy
private Long updatedBy;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.gdschongik.gdsc.domain.common.model;

import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.MappedSuperclass;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@MappedSuperclass
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class BaseSemesterEntity extends BaseEntity {

private Integer academicYear;

@Enumerated(EnumType.STRING)
private SemesterType semesterType;

protected void updateAcademicYear(Integer academicYear) {
this.academicYear = academicYear;
}

protected void updateSemesterType(SemesterType semesterType) {
this.semesterType = semesterType;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdschongik.gdsc.domain.member.domain;
package com.gdschongik.gdsc.domain.common.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -7,7 +7,7 @@
@AllArgsConstructor
public enum RequirementStatus {
PENDING("PENDING"),
VERIFIED("VERIFIED");
SATISFIED("SATISFIED");

private final String value;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.gdschongik.gdsc.domain.common.model;

import java.time.MonthDay;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SemesterType {
FIRST(1, MonthDay.of(3, 1)),
SECOND(2, MonthDay.of(9, 1));

private final Integer value;
private final MonthDay startDate;
}
Loading

0 comments on commit 576419f

Please sign in to comment.