Skip to content

Commit c235141

Browse files
Add default initial Jenkins information
1 parent 0b0d778 commit c235141

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@ FROM docker.io/library/openjdk:17-jdk-slim
22
ENV TZ=Asia/Seoul
33
COPY ./build/libs/mc-workflow-manager-0.2.1.jar /mc-workflow-manager-0.2.1.jar
44
ENTRYPOINT ["java", "-jar", "/mc-workflow-manager-0.2.1.jar"]
5+
6+
FROM docker.io/library/openjdk:17-jdk-slim
7+
8+
ENV TZ=Asia/Seoul
9+
10+
# 애플리케이션 복사
11+
COPY ./build/libs/mc-workflow-manager-0.2.1.jar /mc-workflow-manager-0.2.1.jar
12+
13+
# entrypoint 스크립트 복사 및 실행 권한 부여
14+
COPY entrypoint.sh /entrypoint.sh
15+
RUN chmod +x /entrypoint.sh
16+
17+
# ENTRYPOINT를 스크립트로 설정
18+
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# 외부 IP 가져오기
4+
EXTERNAL_IP=$(curl -s ifconfig.me)
5+
export CB_WORKFLOW_MANAGER_EXTERNAL_IP=$EXTERNAL_IP
6+
7+
echo "Detected external IP: $CB_WORKFLOW_MANAGER_EXTERNAL_IP"
8+
9+
# PostgreSQL INSERT 쿼리 실행
10+
psql "host=$DB_HOST port=$DB_PORT dbname=$DB_NAME user=$DB_USER password=$DB_PASS" <<EOF
11+
INSERT INTO oss (
12+
oss_idx, oss_type_idx, oss_name, oss_desc, oss_url, oss_username, oss_password
13+
) VALUES (
14+
1, 1, 'SampleOss', 'Sample Description',
15+
'http://${CB_WORKFLOW_MANAGER_EXTERNAL_IP}:8053', 'root', null
16+
);
17+
EOF
18+
19+
# 애플리케이션 실행
20+
exec java -jar /mc-workflow-manager-0.2.1.jar

src/main/resources/import.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
INSERT INTO oss_type (oss_type_idx, oss_type_name, oss_type_desc) VALUES (1, 'JENKINS', 'init');
33

44
-- Step 2: Insert into oss
5-
INSERT INTO oss (oss_idx, oss_type_idx, oss_name, oss_desc, oss_url, oss_username, oss_password) VALUES (1, 1, 'SampleOss', 'Sample Description', 'http://sample.com', 'root', null);
5+
-- INSERT INTO oss (oss_idx, oss_type_idx, oss_name, oss_desc, oss_url, oss_username, oss_password) VALUES (1, 1, 'SampleOss', 'Sample Description', 'http://sample.com', 'root', null);
66

77
-- Step 3: Insert into workflow_stage_type (assuming this table exists and 1 is valid)
88
-- 1, 'TUMBLEBUG INFO CHECK', 'TUMBLEBUG INFO CHECK'

0 commit comments

Comments
 (0)