Skip to content

Commit

Permalink
env: Enforce the server's timezone to be set as Asia/Seoul (KST) (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwangjokim authored Jan 8, 2025
1 parent 25f41e4 commit 50b8406
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ jobs:
echo "${{ secrets.EC2_SSH_KEY }}" > private_key.pem
chmod 400 private_key.pem
sudo scp -i private_key.pem -o StrictHostKeyChecking=no build/libs/algohub-0.0.1-SNAPSHOT.jar ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/home/${{ secrets.EC2_USERNAME }}/algohub.jar
sudo ssh -i private_key.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} "pgrep java | xargs kill -9; nohup java -jar /home/${{ secrets.EC2_USERNAME }}/algohub.jar > app.log 2>&1 &"
sudo ssh -i private_key.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} "pgrep java | xargs kill -9; nohup java -jar -Duser.timezone=Asia/Seoul /home/${{ secrets.EC2_USERNAME }}/algohub.jar > app.log 2>&1 &"
rm -f private_key.pem
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ tasks.named('test') {

test {
systemProperty 'spring.profiles.active', 'local'
systemProperty 'user.timezone', 'Asia/Seoul'
}
3 changes: 3 additions & 0 deletions src/main/java/com/gamzabat/algohub/AlgohubApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.gamzabat.algohub;

import java.util.TimeZone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
Expand All @@ -9,6 +11,7 @@
public class AlgohubApplication {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
SpringApplication.run(AlgohubApplication.class, args);
}

Expand Down

0 comments on commit 50b8406

Please sign in to comment.