Skip to content

Commit

Permalink
chore: prod datasource 설정 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eun-byeol committed Nov 29, 2024
1 parent 3bc8bdb commit eb6c5b9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
strategy:
max-parallel: 1 # 직렬처리
matrix:
environment: [ prod, prod-a, prod-b ]
environment: [ prod-a, prod-b ]

steps:
- name: Login to Docker Hub
Expand Down
2 changes: 2 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM openjdk:17-jdk
ARG JAR_FILE=./build/libs/ody-backend-0.0.1-SNAPSHOT.jar

ENV SPRING_PROFILES_ACTIVE=prod
# dev로 변경

ENV JASYPT_ENCRYPTOR_PASSWORD=${JASYPT_ENCRYPTOR_PASSWORD}

COPY ${JAR_FILE} ody-backend.jar
Expand Down
30 changes: 0 additions & 30 deletions backend/src/main/java/com/ody/common/config/DataConfig.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy;

@Slf4j
@Profile("prod__")
@Profile("prod")
@Configuration
public class ReplicationDataSourceConfig {

Expand Down
22 changes: 15 additions & 7 deletions backend/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ spring:
hibernate:
ddl-auto: validate
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(KUJNgDMlvi/imeVHjCO2QekgI4DNxZT9IrW0QlVVkJXJUUQ2DAUOqI91FVH7aFhXVCsfXtf0EUmF/JqN3GpXa/mVj3o4BNbqS3QsU50BgwEEodko+VwHY2ebDHUxlKA1/FXBSmu6p+Rd3rcNEzoBIA==)
username: ENC(jNYhZN6xMCmPQ7GZM+Hu3A==)
password: ENC(VRtr3RjM+XnPvRdLjrPMHyTSzDlEjR7o)
write:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: ENC(KUJNgDMlvi/imeVHjCO2QekgI4DNxZT9IrW0QlVVkJXJUUQ2DAUOqI91FVH7aFhXVCsfXtf0EUmF/JqN3GpXa/mVj3o4BNbqS3QsU50BgwEEodko+VwHY2ebDHUxlKA1/FXBSmu6p+Rd3rcNEzoBIA==)
username: ENC(jNYhZN6xMCmPQ7GZM+Hu3A==)
password: ENC(VRtr3RjM+XnPvRdLjrPMHyTSzDlEjR7o)
read:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: ENC(KUJNgDMlvi/imeVHjCO2QekgI4DNxZT9IrW0QlVVkJXJUUQ2DAUOqI91FVH7aFhXVCsfXtf0EUmF/JqN3GpXa/mVj3o4BNbqS3QsU50BgwEEodko+VwHY2ebDHUxlKA1/FXBSmu6p+Rd3rcNEzoBIA==)
username: ENC(jNYhZN6xMCmPQ7GZM+Hu3A==)
password: ENC(VRtr3RjM+XnPvRdLjrPMHyTSzDlEjR7o)
flyway:
baseline-version: 2

#log:
# file:
# path: /ody-prod-logs
log:
file:
path: /ody-prod-logs
3 changes: 2 additions & 1 deletion backend/src/main/resources/db/migration/V1__init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ create table if not exists notification (
created_at timestamp not null default current_timestamp(),
updated_at timestamp not null default current_timestamp(),
primary key (id),
constraint fk_notification_mate_id foreign key (mate_id) references mate (id)
constraint fk_notification_mate_id foreign key (mate_id) references mate (id),
constraint notification_chk_1 check (`type` IN ('DEPARTURE_REMINDER','ENTRY','NUDGE','MEMBER_DELETION'))
);
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ALTER TABLE notification ADD CONSTRAINT notification_chk_1 CHECK (notification.type IN ('DEPARTURE_REMINDER', 'ENTRY', 'NUDGE', 'MEMBER_DELETION', 'ETA_NOTICE'));
ALTER TABLE notification DROP CONSTRAINT notification_chk_1;
ALTER TABLE notification ADD CONSTRAINT notification_chk_1 CHECK (`type` IN ('DEPARTURE_REMINDER', 'ENTRY', 'NUDGE', 'MEMBER_DELETION', 'ETA_NOTICE'));

0 comments on commit eb6c5b9

Please sign in to comment.