diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index afda5a1..cdbfda2 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -13,17 +13,15 @@ jobs: steps: - name: Deploy Task on Host run: | - echo "Starting Standard CI/CD Deploy pipeline..." - docker run --rm \ - -v /home/ubuntu/app/ax_hub_mcp_tool:/app \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v /home/ubuntu/.gradle:/root/.gradle \ - -w /app \ - eclipse-temurin:21-jdk-jammy \ - /bin/bash -c "git pull && chmod +x gradlew && ./gradlew bootJar -x test" + echo Starting Ultra-Fast Docker-Socket CI/CD Pipeline... - cd /home/ubuntu/app/ax_hub_mcp_tool - find . -name "*-plain.jar" -delete - docker compose down - docker compose up -d --build gateway redis mci-mock dozzle tool-sms tool-email tool-other tool-payment gitea-runner - echo "CI/CD Deploy Success!" + # 1. eclipse-temurin 이미지 구동 후 git 설치 및 pull & build 기동 + docker run --rm -v /home/ubuntu/app/ax_hub_mcp_tool:/app -v /var/run/docker.sock:/var/run/docker.sock -v /home/ubuntu/.gradle:/root/.gradle -w /app eclipse-temurin:21-jdk-jammy /bin/bash -c apt-get update -qq && apt-get install -y -qq git && git pull && chmod +x gradlew && ./gradlew bootJar -x test + + # 2. 빌드 결과 아카이빙 정리 + docker run --rm -v /home/ubuntu/app/ax_hub_mcp_tool:/app -w /app alpine /bin/sh -c find . -name \*-plain.jar\' -delete + + # 3. 호스트 도커 컴포즈 재부팅 제어 + docker run --rm -v /home/ubuntu/app/ax_hub_mcp_tool:/app -v /var/run/docker.sock:/var/run/docker.sock -w /app docker:cli /bin/sh -c docker compose down && docker compose up -d --build gateway redis mci-mock dozzle tool-sms tool-email tool-other tool-payment gitea-runner + + echo CI/CD Deploy Success! diff --git a/docker-compose.yml b/docker-compose.yml index 79f280e..467f167 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: redis: image: redis:latest @@ -29,11 +27,13 @@ services: - SPRING_DATA_REDIS_HOST=redis - SPRING_DATA_REDIS_PORT=6379 - AXHUB_SOURCE_DIR=/src + - JAVA_TOOL_OPTIONS=-Xms64m -Xmx384m + - SPRING_PROFILES_ACTIVE=dev mci-mock: image: wiremock/wiremock:latest ports: - - "8080:8080" + - "8089:8080" volumes: - ./mci-mock:/home/wiremock @@ -51,13 +51,16 @@ services: - SPRING_REDIS_PORT=6379 - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 + - AXHUB_SOURCE_DIR=/src - AXHUB_TOOL_URL=http://tool-sms:8082 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_MCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_MCI_PORT=8080 - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EXTMCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EXTMCI_PORT=8080 - - GLOW_COMMUNICATION_EAI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EAI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EAI_PORT=8080 + - SPRING_PROFILES_ACTIVE=dev + tool-email: build: context: . @@ -73,12 +76,14 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-email:8083 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_MCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_MCI_PORT=8080 - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EXTMCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EXTMCI_PORT=8080 - - GLOW_COMMUNICATION_EAI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EAI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EAI_PORT=8080 + - SPRING_PROFILES_ACTIVE=dev + tool-other: build: context: . @@ -94,18 +99,20 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-other:8084 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_MCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_MCI_PORT=8080 - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EXTMCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EXTMCI_PORT=8080 - - GLOW_COMMUNICATION_EAI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EAI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EAI_PORT=8080 + - SPRING_PROFILES_ACTIVE=dev + tool-payment: build: context: . - dockerfile: dap-tool-payment/Dockerfile + dockerfile: dap-tool-payment=Dockerfile ports: - - "8285:8085" + - "8285:8084" depends_on: - redis environment: @@ -115,9 +122,33 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-payment:8085 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_MCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_MCI_PORT=8080 - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EXTMCI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EXTMCI_PORT=8080 - - GLOW_COMMUNICATION_EAI_HOST=http://mci-mock + - GLOW_COMMUNICATION_EAI_HOMT=http://mci-mock - GLOW_COMMUNICATION_EAI_PORT=8080 + - SPRING_PROFILES_ACTIVE=dev + + dozzle: + image: amir20/dozzle:latest + ports: + - "8288:8080" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + restart: always + + gitea-runner: + image: gitea/act_runner:latest + environment: + - GITEA_INSTANCE_URL=https://git.devjun.net + + - GITEA_RUNNER_REGISTRATION_TOKEN=2N7ciuFIp6Jm29ewtzfl9ruQtpwGgB4ngFcXC2lF + - GITEA_RUNNER_NAME=ociwp-runner + - GLOW_COMMUNICATION_EXTMCI_PORT=8080 + - GITEA_RUNNER_LABELS=ubuntu-latest,ubuntu-22.04,linux-arm64 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./act_runner_data:/data + - ./bin/docker:/usr/bin/docker + restart: always \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755