-
Notifications
You must be signed in to change notification settings - Fork 40
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
base: kih1015
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
마지막 주 고생 많으셨습니다 !
몇 가지 코멘트 남겼으니 확인 부탁드립니다 !
if [ -f "$PID_FILE" ]; then | ||
PID=$(cat $PID_FILE) | ||
if ps -p $PID > /dev/null; then | ||
echo "애플리케이션을 종료 중입니다. (PID: $PID)" | ||
kill -15 $PID | ||
sleep 5 |
There was a problem hiding this comment.
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 파일에 값을 저장하는 로직이 안 보이는 것 같아서, 한 번 확인 부탁드립니다 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 수정하도록 하겠습니다
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'); |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R
production으로 설정을 하면, 애플리케이션 시작 클래스에 ActiveProfile 어노테이션을 작성을 해야할 거 같다는 생각이 들어요 !
There was a problem hiding this comment.
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
설정을 해두긴 했는데 애플리케이션 시작 클래스에 어노테이션 작성하는게 적절해 보여서 수정하도록 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하! 설정 파일이 있었군요.. 놓치고 간 부분 하나 배워갑니다 !
@Value("${security.jwt.token.secret-key}") | ||
private String secretKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C
필드 부분에 작성하면 좋을 것 같습니다 !
7단계
8단계
9단계