Skip to content

Commit

Permalink
Relase 배포 (#104)
Browse files Browse the repository at this point in the history
* <feat>: Entity 생성
Flight, Member, Payment,Reservation, Seat Entity 파일 생성

* <docs>: application.yml 파일 생성

* <refactor>: application.properties 삭제

* refactor: @NoArgsConstructor(access = AccessLevel.PROTECTED) 추가, application.yml 삭제

* docs: ucd, erd 사진 추가

* feat(reservation_history.html): 예약 확인 페이지(결제 대기 페이지) 생성

* chore: jwt, swagger, lombok 빌드 추가

* feat: 로그인, 회원가입 페이지추가(spring security 적용)

* feat: 로그인 필터가 적용되는 기본 페이지 추가 및 페이지 연결

* fix: 로그인한 상태에서 페이지 이동 하는 것과 로그인하지 않은 상태에서 페이지 이동하는 것 수정

* feat: 로그아웃 기능 추가

* refactor: 불필요한 로그 삭제

* feat: 회원가입 페이지에 홈으로 이동하는 버튼 추가

* refactor: 패키지 구조 변경

* fix: swagger config 이름 변경

* refactor: 패키지 구조 변경에 따른 경로 변경

* fix: memberservice interface로 변경

* fix: swagger에서 로그인 사용할 수 있도록 수정

* refactor: 불필요한 코드 삭제

* feat: 회원가입, 로그인 테스트 코드 작성

* fix: 로그인 실패 시 에러 처리 추가

* build(): domain 디렉토리 생성

* fix: no args access level 추가

* feat(): ReservationDto 생성

* Feature/1 (#7)

* chore: jwt, swagger, lombok 빌드 추가

* feat: 로그인, 회원가입 페이지추가(spring security 적용)

* feat: 로그인 필터가 적용되는 기본 페이지 추가 및 페이지 연결

* fix: 로그인한 상태에서 페이지 이동 하는 것과 로그인하지 않은 상태에서 페이지 이동하는 것 수정

* feat: 로그아웃 기능 추가

* refactor: 불필요한 로그 삭제

* feat: 회원가입 페이지에 홈으로 이동하는 버튼 추가

* refactor: 패키지 구조 변경

* fix: swagger config 이름 변경

* refactor: 패키지 구조 변경에 따른 경로 변경

* fix: memberservice interface로 변경

* fix: swagger에서 로그인 사용할 수 있도록 수정

* refactor: 불필요한 코드 삭제

* feat: 회원가입, 로그인 테스트 코드 작성

* fix: 로그인 실패 시 에러 처리 추가

* fix: no args access level 추가

* feat(): 예약 관련 기능 1차 구현

* fix(): Seat entity lombok 관련 수정 및 패키지 이동

* feat: 좌석 조회 기능

* feat(): Flight, Member, Seat Repository 생성

* feat: Payment 기능 작성

* build(): lombok 의존성 수정 및 db 연결

* Feature/5 (#8)

* feat: PigonAir Flight domain

* feat: home.html 구현(navbar 불완전, 보완 필요)

* feat: FlightDataGenerator.java .gitIgnore 추가

* fixed untracked files

* <refactor> login 기능과 flight 기능 merge
PigonAirApplication.java 주석처리된 부분은 난수 flight entity를 db에 100개씩 추가해주는 코드

* refactor: domain 패키지 생성

* fix: dev merge 버그 수정

* chore: dockerfile 추가

* chore: gradle 파일 추가

* fix: 빌드 대상 브랜치 수정

* refactor(): UserDetails 적용

* feat(): 이미 예약단계에 들어간 좌석 체크 기능 추가

* feat(): 예약 버튼 클릭 함수 구현

* fix(): ReservationRequestDto 멤버 변수 setId로만으로 수정

* refactor(): 예외에 따른 분기 처리

* refactor(): 코드 리팩터링

* feat: Home의 티켓 확인페이지와 연결, 결제시 좌석 불가능 변경

* fix: swagger 접속 가능하도록 web config 파일 수정

* fix: swagger 접속 가능하도록 web config 파일 수정

* build(): application.properties 삭제

* refactor: 불필요한 코드 패키지 삭제

* chore: swagger 빌드 추가

* chore: actuator, prometheus 빌드 추가

* Revert "Feature/2/uha" (#16)

* feat: 결제 기능 구현 (#19)

* Delete src/main/resources/application.properties (#21)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경 (#22)

* Feature/5/sungwook (#23)

* feat: PigonAir Flight domain

* feat: home.html 구현(navbar 불완전, 보완 필요)

* feat: FlightDataGenerator.java .gitIgnore 추가

* fixed untracked files

* <refactor> login 기능과 flight 기능 merge
PigonAirApplication.java 주석처리된 부분은 난수 flight entity를 db에 100개씩 추가해주는 코드

* refactor: FlightService.java, FlightServiceImpl.java 분리

* feat: CustomExceptionHandler 에 handleDateTimeFormatException 추가.

* fix: model에 size추가

* feat: whitelist에 조회 페이지 추가

* fix: 프론트 버튼 수정
개선방향: model로 값을 넘겨주고 있는데, 나중에 지연로딩으로 값을 불러올꺼면 fetch로 변경해줘야할것 같다.

* fix: application.properties 삭제

* Feature/11/mingi (#12)

* chore: jwt, swagger, lombok 빌드 추가

* feat: 로그인, 회원가입 페이지추가(spring security 적용)

* feat: 로그인 필터가 적용되는 기본 페이지 추가 및 페이지 연결

* fix: 로그인한 상태에서 페이지 이동 하는 것과 로그인하지 않은 상태에서 페이지 이동하는 것 수정

* feat: 로그아웃 기능 추가

* refactor: 불필요한 로그 삭제

* feat: 회원가입 페이지에 홈으로 이동하는 버튼 추가

* refactor: 패키지 구조 변경

* fix: swagger config 이름 변경

* refactor: 패키지 구조 변경에 따른 경로 변경

* fix: memberservice interface로 변경

* fix: swagger에서 로그인 사용할 수 있도록 수정

* refactor: 불필요한 코드 삭제

* feat: 회원가입, 로그인 테스트 코드 작성

* fix: 로그인 실패 시 에러 처리 추가

* fix: no args access level 추가

* chore: dockerfile 추가

* chore: gradle 파일 추가

* fix: 빌드 대상 브랜치 수정

* fix: swagger 접속 가능하도록 web config 파일 수정

* fix: swagger 접속 가능하도록 web config 파일 수정

* refactor: 불필요한 코드 패키지 삭제

* chore: swagger 빌드 추가

* chore: actuator, prometheus 빌드 추가

* fix: 각 uri에 대한 접근 해제

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor: caddy 설정 삭제

* Feature/3/suhyun (#26)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor: webconfig 경로 수정

* refactor: grafana, prometheus 접속 경로 추가

* refactor: ngrinder 경로 삭제

* fix: 테스트 통과해야 그 다음으로 넘어가도록 수정

* chore: 불필요한 junit 파일 삭제

* fix: 테스트 코드 수정

* chore: h2 데이터 베이스 의존성 추가 (테스트 용)

* chore: application 파일 yml로 수정, test 용 application.yml 추가

* fix: 테스트 코드 파일 이름 수정, 위치 변경

* chore: 테스트용 application.yml 위한 폴더 추가

* refactor(): custoemException 적용

* Feature/28/sungwook (#30)

* fix: 필요없는 test 삭제, build.gradle 충돌 지점 삭제

* fix: 필요없는 test 삭제

* feature: FlightDataGeneratorTest 파일 생성 원하는 개수의 flight dummy data 생성. 방향은 0에서 3으로, FlightDataGenerator.java 42,43 수정하여 완전한 랜덤값 생성 가능

* feature: DATABASE_ERROR, INVALID_PATH_VARIABLE, INVALID_SEARCH_CONDITION 추가

* feature: Controller 단에서 Service 단의 error를 catch하도록 설정

* feature: 프론트단 가독성 개선

* fix: FlightDataGenerator Test로 이식 완료
PigonAirApplication 주석 제거

* Feature/2/uha (#31)

* feat: 티켓 정보 null일 경우

* feat: 결제, 예약 분리, 결제 testCode 작성

* refactor: 결제 testCode 수정

* Update ErrorCode.java

* fix: /home -> /으로 uri 변경

* fix: global page controller 추가, 수정

* fix: 불필요한 api 삭제

* fix: logout deprecated 삭제

* Feature/3/suhyun (#32)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor(): custoemException 적용

* Update ErrorCode.java

---------

Co-authored-by: LEESUNGWOOK <[email protected]>

* fix(): 슬래시 삭제

* Feature/4/donghwi (#35)

* refactor: List 반환 -> Result 객체로 감싸줌

* refactor: dev merge

* refactor: delete(logger.error), test주석

* refactor: reservation '/' 삭제

* fix: logout deprecated 삭제

* refactor: 결제 완료시 티켓에 결제 버튼 숨김

* refactor: 티켓 리스트 형식으로 출력, 결제 실패시 /ticket으로 이동

* test: 테스트 수정

* refactor(): 예약이 정상적으로 진행되지 않은 경우 현재 페이지 새로고침으로 변경

* feat(): 예약 취소 구현

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* Feature/3/suhyun (#40)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor(): custoemException 적용

* Update ErrorCode.java

* fix(): 슬래시 삭제

* refactor(): 예약이 정상적으로 진행되지 않은 경우 현재 페이지 새로고침으로 변경

* feat(): 예약 취소 구현

---------

Co-authored-by: LEESUNGWOOK <[email protected]>

* chore: pinpoint 사용하지 않으므로 빌드 파일 수정

* chore: elastic apm을 위한 보안 규칙 수정

* chore: elastic apm을 위해 docker file 수정 및 agent 파일 추가

* fix: apm server 로그인 처리를 위해 로그인 필터 uri 변경

* fix: /checklogin uri 추가

* fix: /checklogin uri 다시 제거

* fix: cors 설정 추가

* fix: http host 사용하지 않도록 수정

* chore: logging 추가

* fix: cors 문제 해결하도록 수정

* fix: logging 삭제

* feat: release, dev 브랜치에 따라 다르게 deploy 되도록 작성

* fix: gradle 조건문 수정

* Release 1.0.0 (#45)

* fix: logout deprecated 삭제

* refactor: 결제 완료시 티켓에 결제 버튼 숨김

* refactor: 티켓 리스트 형식으로 출력, 결제 실패시 /ticket으로 이동

* test: 테스트 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 사용하지 않으므로 빌드 파일 수정

* chore: elastic apm을 위한 보안 규칙 수정

* chore: elastic apm을 위해 docker file 수정 및 agent 파일 추가

* fix: apm server 로그인 처리를 위해 로그인 필터 uri 변경

* fix: /checklogin uri 추가

* fix: /checklogin uri 다시 제거

* fix: cors 설정 추가

* fix: http host 사용하지 않도록 수정

* chore: logging 추가

* fix: cors 문제 해결하도록 수정

* fix: logging 삭제

* feat: release, dev 브랜치에 따라 다르게 deploy 되도록 작성

* fix: gradle 조건문 수정

---------

Co-authored-by: uha9218 <[email protected]>
Co-authored-by: uha9218 <[email protected]>

* fix: eip로 ip 주소 수정

* fix(): api 엔드 포인트 수정 (api->app-api)

* Release 1.0.0 (#46)

* fix: logout deprecated 삭제

* refactor: 결제 완료시 티켓에 결제 버튼 숨김

* refactor: 티켓 리스트 형식으로 출력, 결제 실패시 /ticket으로 이동

* test: 테스트 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 사용하지 않으므로 빌드 파일 수정

* chore: elastic apm을 위한 보안 규칙 수정

* chore: elastic apm을 위해 docker file 수정 및 agent 파일 추가

* fix: apm server 로그인 처리를 위해 로그인 필터 uri 변경

* fix: /checklogin uri 추가

* fix: /checklogin uri 다시 제거

* fix: cors 설정 추가

* fix: http host 사용하지 않도록 수정

* chore: logging 추가

* fix: cors 문제 해결하도록 수정

* fix: logging 삭제

* feat: release, dev 브랜치에 따라 다르게 deploy 되도록 작성

* fix: gradle 조건문 수정

* fix: eip로 ip 주소 수정

---------

Co-authored-by: uha9218 <[email protected]>
Co-authored-by: uha9218 <[email protected]>

* refactor(): 예약 취소 - 예약자 확인 로직 추가

* feat(): 테스트를 위한 MemberGenerator 생성

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* fix(): app-api 경로 이름 삭제 (#52)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정 (#51)

* Release 1.0.0  (#49)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor(): custoemException 적용

* Update ErrorCode.java

* fix(): 슬래시 삭제

* fix: logout deprecated 삭제

* refactor: 결제 완료시 티켓에 결제 버튼 숨김

* refactor: 티켓 리스트 형식으로 출력, 결제 실패시 /ticket으로 이동

* test: 테스트 수정

* refactor(): 예약이 정상적으로 진행되지 않은 경우 현재 페이지 새로고침으로 변경

* feat(): 예약 취소 구현

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 사용하지 않으므로 빌드 파일 수정

* chore: elastic apm을 위한 보안 규칙 수정

* chore: elastic apm을 위해 docker file 수정 및 agent 파일 추가

* fix: apm server 로그인 처리를 위해 로그인 필터 uri 변경

* fix: /checklogin uri 추가

* fix: /checklogin uri 다시 제거

* fix: cors 설정 추가

* fix: http host 사용하지 않도록 수정

* chore: logging 추가

* fix: cors 문제 해결하도록 수정

* fix: logging 삭제

* feat: release, dev 브랜치에 따라 다르게 deploy 되도록 작성

* fix: gradle 조건문 수정

* fix: eip로 ip 주소 수정

* fix(): api 엔드 포인트 수정 (api->app-api)

* refactor(): 예약 취소 - 예약자 확인 로직 추가

* feat(): 테스트를 위한 MemberGenerator 생성

* fix(): app-api 경로 이름 삭제 (#52)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정 (#51)

---------

Co-authored-by: suhyun9764 <[email protected]>
Co-authored-by: admiNHyun <[email protected]>
Co-authored-by: LEESUNGWOOK <[email protected]>
Co-authored-by: uha9218 <[email protected]>
Co-authored-by: uha9218 <[email protected]>

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* Feature/50 (#53)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* Release1.0.0 (#54)

* fix(): Member, Reservation 연관관계 ManyToOne, Seat Reservation연관관계 OneToOne으로 변경

* feat(): 1분(추후에 15분으로 변경)안에 결제가 되지 않을 시 예약좌석 lock 풀기 및 예약 삭제

* refactor(): custoemException 적용

* Update ErrorCode.java

* fix(): 슬래시 삭제

* fix: logout deprecated 삭제

* refactor: 결제 완료시 티켓에 결제 버튼 숨김

* refactor: 티켓 리스트 형식으로 출력, 결제 실패시 /ticket으로 이동

* test: 테스트 수정

* refactor(): 예약이 정상적으로 진행되지 않은 경우 현재 페이지 새로고침으로 변경

* feat(): 예약 취소 구현

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 환경 구성을 위해 endpoint 수정

* chore: pinpoint 사용하지 않으므로 빌드 파일 수정

* chore: elastic apm을 위한 보안 규칙 수정

* chore: elastic apm을 위해 docker file 수정 및 agent 파일 추가

* fix: apm server 로그인 처리를 위해 로그인 필터 uri 변경

* fix: /checklogin uri 추가

* fix: /checklogin uri 다시 제거

* fix: cors 설정 추가

* fix: http host 사용하지 않도록 수정

* chore: logging 추가

* fix: cors 문제 해결하도록 수정

* fix: logging 삭제

* feat: release, dev 브랜치에 따라 다르게 deploy 되도록 작성

* fix: gradle 조건문 수정

* fix: eip로 ip 주소 수정

* fix(): api 엔드 포인트 수정 (api->app-api)

* refactor(): 예약 취소 - 예약자 확인 로직 추가

* feat(): 테스트를 위한 MemberGenerator 생성

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* fix(): app-api 경로 이름 삭제 (#52)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정 (#51)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* Feature/50 (#53)

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

---------

Co-authored-by: suhyun9764 <[email protected]>
Co-authored-by: admiNHyun <[email protected]>
Co-authored-by: LEESUNGWOOK <[email protected]>
Co-authored-by: uha9218 <[email protected]>
Co-authored-by: uha9218 <[email protected]>

* fix: dev, release 별로 application.yml 다르게 적용되도록 수정

* fix: dev, release 별로 application.yml 다르지 않도록 수정

* fix: pigonair-dev 도메인도 CORS 허용하도록 수정

* chore: release에 필요한 설정 파일들 추가

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

* chore: release되도록 설정 파일 수정

---------

Co-authored-by: gbk1414 <[email protected]>
Co-authored-by: suhyun9764 <[email protected]>
Co-authored-by: DongHwi Kim <[email protected]>
Co-authored-by: uha9218 <[email protected]>
Co-authored-by: LEESUNGWOOK <[email protected]>
Co-authored-by: dongdaeun <[email protected]>
Co-authored-by: uha9218 <[email protected]>
Co-authored-by: admiNHyun <[email protected]>
  • Loading branch information
9 people authored May 2, 2024
1 parent b361526 commit 1f35eaa
Show file tree
Hide file tree
Showing 84 changed files with 4,517 additions and 22 deletions.
33 changes: 33 additions & 0 deletions .github/release-note.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name-template: 'PigonAir v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🆕 새로운 기능이 추가되었어요!'
label: '✨ Feature'
- title: '🐞 자잘한 버그를 수정했습니다.'
label: '🐞 Bugfix'
- title: '🫶🏻 앱 사용성 개선에 힘썼습니다.'
label: '🫶🏻 Improvement'
- title: '🛠️ 더 나은 코드를 위해 노력하고 있습니다.'
labels:
- '🔨 Refactor'
- '⚙️ Setting'
- title: 'ETC'
labels:
- "*"
change-template: '* $TITLE (#$NUMBER) by @$AUTHOR'
change-title-escapes: '\<*_&#@`'
exclude-labels:
- 'Main'
version-resolver:
major:
labels:
- 'Major'
minor:
labels:
- 'Minor'
patch:
labels:
- 'Patch'
default: patch
template: |
$CHANGES
92 changes: 92 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
pull_request:
branches: [ "dev" ]
# 사용할 인프라의 이름을 변수 형태로 저장 가능
jobs:

build:
# 실행 환경 지정
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
# Task의 sequence를 명시한다.
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Create directory for application.yml
run: mkdir -p ./src/main/resources/

- name: Create directory for TEST application.yml
run: mkdir -p ./src/test/resources/

- name: Generate application.yml
run: echo "${{ secrets.APPLICATION_PROPERTIES_CONTENT }}" > ./src/main/resources/application.yml

- name: Generate TEST application.yml
run: echo "${{ secrets.TEST_APPLICATION_PROPERTIES_CONTENT }}" > ./src/test/resources/application.yml

- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

# Gradle build (Test 제외)
- name: Build with Gradle
run: ./gradlew clean build

- name: Docker build & push to docker repo
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ github.run_number }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ github.run_number }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: AWS EC2 Connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST_DEV }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_PEM }}
port: ${{ secrets.EC2_PORT }}
timeout: 60s
script: |
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ github.run_number }}
sudo bash deploy-githubActions.sh ${{ github.run_number }}
sudo docker image prune -f
105 changes: 105 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main" ]
# 사용할 인프라의 이름을 변수 형태로 저장 가능
jobs:

build:
# 실행 환경 지정
runs-on: ubuntu-latest
outputs:
resolved_version: ${{ steps.get_version.outputs.tag_name }}

# Task의 sequence를 명시한다.
steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Create directory for application.yml
run: mkdir -p ./src/main/resources/

- name: Create directory for TEST application.yml
run: mkdir -p ./src/test/resources/

- name: Generate application.yml
run: echo "${{ secrets.APPLICATION_PROPERTIES_CONTENT }}" > ./src/main/resources/application.yml

- name: Generate TEST application.yml
run: echo "${{ secrets.TEST_APPLICATION_PROPERTIES_CONTENT }}" > ./src/test/resources/application.yml

- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash

# Gradle build (Test 제외)
- name: Build with Gradle
run: ./gradlew clean build


- name: Get the latest release tag
id: get_version
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/releases/latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Docker build & push to docker repo
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.tag_name }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.tag_name }}
deploy:
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
# needs를 통해 build job이 수행 성공시에 작업되도록 설정
needs: build
runs-on: ubuntu-latest
steps:
# 권한 부여
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: AWS EC2 Connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_PEM }}
port: ${{ secrets.EC2_PORT }}
timeout: 60s
script: | #Docker Image명 기입, port 기입
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.tag_name }}
cd ~
sudo docker-compose up -d
sudo docker image prune -f
21 changes: 21 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Drafter

on:
push:
branches: [ "main" ]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 표준 GitHub 자동 생성 토큰 사용
with:
config-name: release-note.yml
commitish: 'main' # "main" 브랜치를 기준으로 설정
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Tag

on:
push:
branches:
- main # main branch로 push될 때 아래 action이 실행됩니다.

jobs:
build:

runs-on: ubuntu-latest

steps:

# 깃헙 코드 내려받기
- uses: actions/checkout@v2

# 태그 생성
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected] # 가져다 쓸 auto tagging 프로그램
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # secrets.GITHUB_TOKEN 는 자동생성됨

# 릴리즈 생성
- name: Create Release
id: create_release
uses: actions/create-release@v1 # 가져다 쓸 create release 프로그램
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # secrets.GITHUB_TOKEN 는 자동생성됨
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

application.properties
### STS ###
.apt_generated
.classpath
Expand All @@ -18,6 +18,8 @@ bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
FlightDataGenerator.java
application.yml
.idea
*.iws
*.iml
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:17
WORKDIR /app
ARG JAR_FILE=build/libs/*.jar
ARG APM_AGENT_FILE=elastic-apm-agent-1.49.0.jar
COPY ${JAR_FILE} app.jar
COPY ${APM_AGENT_FILE} elastic-apm-agent.jar
EXPOSE 8080
CMD ["java","-jar","app.jar"]
ENTRYPOINT ["java", "-javaagent:elastic-apm-agent.jar", "-Delastic.apm.service_name=application-server", "-Delastic.apm.server_urls=http://13.125.23.24:8200", "-Delastic.apm.application_packages=com.example.pigonair", "-jar", "app.jar"]
25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ java {

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}

dependencies {
Expand All @@ -23,12 +24,34 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
implementation 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

runtimeOnly 'com.mysql:mysql-connector-j'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
// h2
testImplementation 'com.h2database:h2:1.4.200'
// JWT
compileOnly group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
//Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'

//Prometheus
implementation 'io.micrometer:micrometer-registry-prometheus'
// iamport
implementation group: 'com.github.iamport', name: 'iamport-rest-client-java', version: '0.2.22'
implementation group: 'com.squareup.retrofit2', name: 'adapter-rxjava2', version: '2.9.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.3'
implementation group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.3.0'


runtimeOnly 'com.h2database:h2'
}

tasks.named('test') {
Expand Down
Binary file added elastic-apm-agent-1.49.0.jar
Binary file not shown.
Binary file added finalProject_erd (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added finalProject_ucd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gradlew
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file is generated by the 'io.freefair.lombok' Gradle plugin
config.stopBubbling = true
Loading

0 comments on commit 1f35eaa

Please sign in to comment.