feat(deploy-mining): rebuild命令增加服务重启功能

rebuild命令现在会在构建完成后自动停止旧服务并启动新服务,
而不仅仅是编译镜像。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-11 17:18:25 -08:00
parent a539b33dff
commit ace1e8673b
2 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { Controller, Get, Param, Query } from '@nestjs/common'; import { Controller, Get, Param, Query, NotFoundException } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger'; import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger';
import { GetContributionAccountQuery } from '../../application/queries/get-contribution-account.query'; import { GetContributionAccountQuery } from '../../application/queries/get-contribution-account.query';
import { GetContributionStatsQuery } from '../../application/queries/get-contribution-stats.query'; import { GetContributionStatsQuery } from '../../application/queries/get-contribution-stats.query';

View File

@ -386,7 +386,19 @@ service_build() {
service_rebuild() { service_rebuild() {
local service="$1" local service="$1"
local no_cache="$2" local no_cache="$2"
# 1. Build the service
service_build "$service" "$no_cache" service_build "$service" "$no_cache"
# 2. Stop the old service
log_info "Stopping old $service..."
service_stop "$service"
# 3. Start the new service
log_info "Starting new $service..."
service_start "$service"
log_success "$service rebuilt and restarted successfully"
} }
# =========================================================================== # ===========================================================================