Skip to content

Commit 7179479

Browse files
authored
Fix: Redis 실행 문제 및 자동 배포 워크플로우 수정
* Chore: deploy.yml 일부 코드 수정 - OWNER_LC 받는 방법 변경 ( 기존 : toLower({{ toLower(env.OWNER) }}) -> 변경: ${OWNER,,} ) * Fix: Embedded Redis 설정 변경 - 사용자가 Mac 환경인 경우 embedded-redis를 건너뛰도록 - Docker-compose Redis 설정 추가 (Mac 유저가 Redis를 사용할 수 있도록)
1 parent dbf9069 commit 7179479

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: set lower case owner name
6262
run: |
63-
echo "OWNER_LC=${{ toLower(env.OWNER) }}" >> ${GITHUB_ENV}
63+
echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
6464
6565
6666
- name: 빌드 앤 푸시

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3.9"
2+
3+
services:
4+
redis:
5+
image: redis:6.2
6+
container_name: local-redis
7+
ports:
8+
- "6379:6379"
9+
volumes:
10+
- redis_data:/data
11+
command: ["redis-server", "--appendonly", "yes"]
12+
13+
volumes:
14+
redis_data:

src/main/java/com/back/global/config/EmbeddedRedisConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ public class EmbeddedRedisConfig {
2525
@PostConstruct
2626
public void startRedis() {
2727
try {
28+
String osName = System.getProperty("os.name").toLowerCase();
29+
30+
// Mac 환경이면 embedded-redis 건너뛰고 docker-compose Redis 사용
31+
if (osName.contains("mac")) {
32+
System.out.println("Mac 환경 감지 → embedded-redis 비활성화, docker-compose Redis 사용");
33+
System.setProperty("spring.data.redis.port", "6379"); // docker-compose 기본 포트
34+
return;
35+
}
36+
2837
this.port = findAvailablePort();
2938
this.redisServer = new RedisServer(port);
3039
this.redisServer.start();

0 commit comments

Comments
 (0)