Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spring Core] 강인화 미션 제출합니다. #98

Open
wants to merge 5 commits into
base: kih1015
Choose a base branch
from

Conversation

kih1015
Copy link

@kih1015 kih1015 commented Oct 5, 2024

7단계

  • JwtProvider 외부 패키지로 분리
  • @configuration, @bean 이용해서 JwtProvider를 Spring Bean으로 설정
  • 이미 JwtProvider에서 DB에 접근하지 않음

8단계

  • schema.sql DDL만 처리하도록 변경
  • production 초기 데이터와 test 초기 데이터 분리

9단계

  • setup.sh: 초기 설정 스크립트 구현
  • deploy.sh: 배포 스크립트 구현

Copy link

@Soundbar91 Soundbar91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마지막 주 고생 많으셨습니다 !

몇 가지 코멘트 남겼으니 확인 부탁드립니다 !

Comment on lines +25 to +30
if [ -f "$PID_FILE" ]; then
PID=$(cat $PID_FILE)
if ps -p $PID > /dev/null; then
echo "애플리케이션을 종료 중입니다. (PID: $PID)"
kill -15 $PID
sleep 5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R

제가 이해한 게 맞는지 모르겠지만, PID 파일 내부에는 현재 실행 중인 PID 값이 들어가고 이 값을 이용해서 현재 실행 중인 프로세스를 종료하는 방식으로 이해를 했습니다.

deploy.sh에는 PID 파일에 값을 저장하는 로직이 안 보이는 것 같아서, 한 번 확인 부탁드립니다 !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 수정하도록 하겠습니다

Comment on lines +21 to +25
public void run(String... args) {
jdbcTemplate.execute("""
INSERT INTO member (name, email, password, role)
VALUES ('어드민', 'admin@email.com', 'password', 'ADMIN'),
('브라운', 'brown@email.com', 'password', 'USER');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A

repository를 사용하지 않고, jdbc를 이용해서 값을 넣어주셨군요 !

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

@Profile("production")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R

production으로 설정을 하면, 애플리케이션 시작 클래스에 ActiveProfile 어노테이션을 작성을 해야할 거 같다는 생각이 들어요 !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application.properties 파일에 spring.profiles.active=production 설정을 해두긴 했는데 애플리케이션 시작 클래스에 어노테이션 작성하는게 적절해 보여서 수정하도록 하겠습니다!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하! 설정 파일이 있었군요.. 놓치고 간 부분 하나 배워갑니다 !

Comment on lines 186 to 187
@Value("${security.jwt.token.secret-key}")
private String secretKey;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C

필드 부분에 작성하면 좋을 것 같습니다 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants