42 lines
733 B
Batchfile
42 lines
733 B
Batchfile
|
@echo off
|
||
|
setlocal enabledelayedexpansion
|
||
|
|
||
|
:: Static Environment Variables
|
||
|
set BUILD_OUTPUT_PATH=build\docker
|
||
|
set IMAGE_NAME=hay1tsme/bananatools-build:latest
|
||
|
set CONTAINER_NAME=bananatools-build
|
||
|
|
||
|
:: Main Execution
|
||
|
docker build . -t %IMAGE_NAME%
|
||
|
|
||
|
if ERRORLEVEL 1 (
|
||
|
goto failure
|
||
|
)
|
||
|
|
||
|
docker create --name %CONTAINER_NAME% %IMAGE_NAME%
|
||
|
|
||
|
if ERRORLEVEL 1 (
|
||
|
goto failure
|
||
|
)
|
||
|
|
||
|
rd /s /q "!BUILD_OUTPUT_PATH!"
|
||
|
mkdir "!BUILD_OUTPUT_PATH!"
|
||
|
|
||
|
docker cp %CONTAINER_NAME%:/bananatools/build/zip %BUILD_OUTPUT_PATH%
|
||
|
|
||
|
docker rm -f %CONTAINER_NAME%
|
||
|
docker image rm -f %IMAGE_NAME%
|
||
|
|
||
|
goto success
|
||
|
|
||
|
:failure
|
||
|
echo bananatools Docker build FAILED!
|
||
|
goto finish
|
||
|
|
||
|
:success
|
||
|
echo bananatools Docker build completed successfully.
|
||
|
goto finish
|
||
|
|
||
|
:finish
|
||
|
pause
|