-
Notifications
You must be signed in to change notification settings - Fork 24
[3์ฃผ์ฐจ] ๐ 2๋จ๊ณ - ๋ค์ค ์๋น์ค ํ ์คํธ ํ๊ฒฝ #23
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
base: joydaheecha
Are you sure you want to change the base?
Changes from all commits
b3e7831
992f060
d1139ca
3a5dd1a
55fee32
3e656a2
e8f203b
adda73e
6617f9f
1c9ebd4
6c52cff
95373f0
bbcf680
32d7728
7891c12
d1f57e8
6174c0d
bba58d6
188e5ef
5de93b2
2e745bf
7e9f737
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,41 +39,51 @@ tasks.test { | |
|
|
||
| tasks.register("cloneRepository") { | ||
| group = "setup" | ||
| description = "Clone atdd-camping-kiosk repository" | ||
| description = "Clone required repositories" | ||
|
|
||
| doLast { | ||
| val reposDir = file("repos") | ||
| val targetDir = file("repos/atdd-camping-kiosk") | ||
|
|
||
| // repos ๋๋ ํ ๋ฆฌ ์์ฑ | ||
| if (!reposDir.exists()) { | ||
| reposDir.mkdirs() | ||
| println("Created repos directory") | ||
| } | ||
|
|
||
| // ์ด๋ฏธ ํด๋ก ๋ ๊ฒฝ์ฐ ์คํต | ||
| if (targetDir.exists()) { | ||
| println("Repository already exists at ${targetDir.absolutePath}") | ||
| return@doLast | ||
| } | ||
|
|
||
| // Git ํด๋ก ์คํ | ||
| val gitCloneCommand = listOf( | ||
| "git", "clone", | ||
| "https://github.com/next-step/atdd-camping-kiosk.git", | ||
| "repos/atdd-camping-kiosk" | ||
| // ํด๋ก ํ ์ ์ฅ์ ๋ชฉ๋ก | ||
| val repositories = listOf( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๊ฐ์ ธ ์ฌ ๋ธ๋์น ๋ช ๋ ๊ฐ ์๋น์ค๋ณ๋ก ๋ฐ๋ก ๊ด๋ฆฌํด์ค๋ ์ข์ ๊ฒ ๊ฐ๋ค์ :) |
||
| "https://github.com/next-step/atdd-camping-kiosk.git" to "repos/atdd-camping-kiosk", | ||
| "https://github.com/next-step/atdd-camping-admin.git" to "repos/atdd-camping-admin", | ||
| "https://github.com/next-step/atdd-camping-reservation.git" to "repos/atdd-camping-reservation" | ||
| ) | ||
|
|
||
| val process = ProcessBuilder(gitCloneCommand) | ||
| .directory(projectDir) | ||
| .inheritIO() | ||
| .start() | ||
|
|
||
| val exitCode = process.waitFor() | ||
| if (exitCode == 0) { | ||
| println("Successfully cloned repository to repos/atdd-camping-kiosk") | ||
| } else { | ||
| throw GradleException("Failed to clone repository (exit code: $exitCode)") | ||
| repositories.forEach { (repoUrl, targetPath) -> | ||
| val targetDir = file(targetPath) | ||
|
|
||
| // ์ด๋ฏธ ํด๋ก ๋ ๊ฒฝ์ฐ ์คํต | ||
| if (targetDir.exists()) { | ||
| println("Repository already exists at ${targetDir.absolutePath}") | ||
| return@forEach | ||
| } | ||
|
|
||
| // Git ํด๋ก ์คํ | ||
| val gitCloneCommand = listOf( | ||
| "git", "clone", | ||
| repoUrl, | ||
| targetPath | ||
| ) | ||
|
|
||
| val process = ProcessBuilder(gitCloneCommand) | ||
| .directory(projectDir) | ||
| .inheritIO() | ||
| .start() | ||
|
|
||
| val exitCode = process.waitFor() | ||
| if (exitCode == 0) { | ||
| println("Successfully cloned repository to $targetPath") | ||
| } else { | ||
| throw GradleException("Failed to clone repository $repoUrl (exit code: $exitCode)") | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,12 @@ | ||
| -- Create tables if not exist (so we can seed before apps start) | ||
| CREATE TABLE IF NOT EXISTS customers ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์๋น์ค์ ๋ง๊ฒ ํ์ํ ํ ์ด๋ธ ์ถ๊ฐ ๐ |
||
| id BIGINT AUTO_INCREMENT PRIMARY KEY, | ||
| name VARCHAR(255) NOT NULL, | ||
| email VARCHAR(255) NOT NULL, | ||
| phone_number VARCHAR(32), | ||
| UNIQUE KEY uk_customers_email (email) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS products ( | ||
| id BIGINT AUTO_INCREMENT PRIMARY KEY, | ||
| name VARCHAR(255) NOT NULL, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,17 +10,59 @@ services: | |
| environment: | ||
| # Payment service configuration | ||
| - PAYMENTS_SECRET_KEY=test_sk_dummy | ||
| # Override admin service URL for Docker environment | ||
| - KIOSK_ADMIN_BASE-URL=http://camping-admin:8081 | ||
| restart: unless-stopped | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 40s | ||
| networks: | ||
| - kiosk-network | ||
| - atdd-net | ||
| depends_on: | ||
| - admin | ||
|
|
||
| admin: | ||
| build: | ||
| context: .. | ||
| dockerfile: infra/dockerfiles/Dockerfile-admin | ||
| image: camping-admin:latest | ||
| container_name: camping-admin | ||
| ports: | ||
| - "8081:8081" | ||
| environment: | ||
| # Admin service configuration | ||
| - SPRING_PROFILES_ACTIVE=docker | ||
| # Database configuration for shared DB | ||
| - SPRING_DATASOURCE_URL=jdbc:mysql://atdd-db:3306/atdd?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul | ||
| - SPRING_DATASOURCE_USERNAME=root | ||
| - SPRING_DATASOURCE_PASSWORD=secret | ||
| - SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver | ||
| - SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.MySQL8Dialect | ||
| - SPRING_JPA_HIBERNATE_DDL_AUTO=none | ||
|
Comment on lines
+31
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๊ณตํต์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋ ๋ถ๋ถ์ ๋ฌถ์ด์ ์ฌ์ฌ์ฉํด๋ณผ ์ ์๋๋ฐ ์ฐธ๊ณ ํด๋ณด์ธ์ :) |
||
| restart: unless-stopped | ||
| networks: | ||
| - atdd-net | ||
|
|
||
| reservation: | ||
| build: | ||
| context: .. | ||
| dockerfile: infra/dockerfiles/Dockerfile-reservation | ||
| image: camping-reservation:latest | ||
| container_name: camping-reservation | ||
| ports: | ||
| - "8082:8082" | ||
| environment: | ||
| # Reservation service configuration | ||
| - SPRING_PROFILES_ACTIVE=docker | ||
| # Database configuration for shared DB | ||
| - SPRING_DATASOURCE_URL=jdbc:mysql://atdd-db:3306/atdd?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul | ||
| - SPRING_DATASOURCE_USERNAME=root | ||
| - SPRING_DATASOURCE_PASSWORD=secret | ||
| - SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver | ||
| - SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.MySQL8Dialect | ||
| - SPRING_JPA_HIBERNATE_DDL_AUTO=none | ||
| restart: unless-stopped | ||
| networks: | ||
| - atdd-net | ||
|
|
||
| networks: | ||
| kiosk-network: | ||
| driver: bridge | ||
| name: camping-kiosk-network | ||
| atdd-net: | ||
| name: atdd-net | ||
| external: true | ||
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.
ํด๋น ํ์ผ์ด ๋ณด์ด์ง ์๋ค์!
์ด ํ์ผ๋ค์ ์์ ๋ clone๊ณผ ๋ง์ฐฌ๊ฐ์ง๋ก gradle task๋ก ์ฎ๊ฒจ๋ณด๋๊ฑด ์ด๋จ๊น์?