(improvement)(chat) Support specifying spring.profiles.active at runtime to optimize the entire Docker deployment script. (#1302)

This commit is contained in:
lexluo09
2024-06-30 21:30:30 +08:00
committed by GitHub
parent c8b6af4887
commit b59c1303cc
5 changed files with 79 additions and 37 deletions

36
docker/docker-build.bat Normal file
View File

@@ -0,0 +1,36 @@
@echo off
setlocal
REM Function to execute the build script
:execute_build_script
echo Executing build script: assembly\bin\supersonic-build.bat
call assembly\bin\supersonic-build.bat
if %errorlevel% neq 0 (
echo Build script failed. Exiting.
exit /b 1
)
goto :eof
REM Function to build the Docker image
:build_docker_image
set "version=%1"
echo Building Docker image: supersonic:%version%
docker build --no-cache --build-arg SUPERSONIC_VERSION=%version% -t supersonic:%version% -f docker\Dockerfile .
if %errorlevel% neq 0 (
echo Docker build failed. Exiting.
exit /b 1
)
echo Docker image supersonic:%version% built successfully.
goto :eof
REM Main script execution
set "VERSION=%1"
if "%VERSION%"=="" (
echo Usage: %0 ^<version^>
exit /b 1
)
call :execute_build_script
call :build_docker_image %VERSION%
endlocal