From cd5ec06528d533062c43c200a2031dcfd8c6f7c8 Mon Sep 17 00:00:00 2001 From: rentu Date: Thu, 20 Jun 2019 06:26:14 +0100 Subject: [PATCH] Do not use build arg to support Azure Pipeline --- BuildWindowsBits.cmd | 28 ++++++++++++++++++++++------ Dockerfile.windows-amd64 | 5 +++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/BuildWindowsBits.cmd b/BuildWindowsBits.cmd index 8bd0d51..9bab4d3 100644 --- a/BuildWindowsBits.cmd +++ b/BuildWindowsBits.cmd @@ -3,9 +3,18 @@ SETLOCAL EnableDelayedExpansion set PROJECT_PATH=%1 set PROJECT_OUTPUT_PATH=%2 -set PROJECT_CONFIGURATION="%3" +set PROJECT_CONFIGURATION=%3 set UCRT_DLL_PATH="%WindowsSdkVerBinPath%\x64\ucrt" set VS_CRT_REDIST_WILDCARD_FOLDER= ("%VcToolsRedistDir%onecore\x64\Microsoft.VC*.CRT") +set DEFAULT_OUTPUT_PATH="%~dp0\iotedgeoutput\bin" + +if "%PROJECT_OUTPUT_PATH%" == "" ( + set PROJECT_OUTPUT_PATH=%DEFAULT_OUTPUT_PATH% +) + +if "%PROJECT_CONFIGURATION%" == "" ( + set PROJECT_CONFIGURATION="Release" +) :: Check execution environment if "%VSINSTALLDIR%" == "" ( @@ -13,8 +22,8 @@ if "%VSINSTALLDIR%" == "" ( ) for /D %%A in %VS_CRT_REDIST_WILDCARD_FOLDER% do ( - call robocopy.exe "%%~A" %PROJECT_OUTPUT_PATH% /S /E >nul - if !ERRORLEVEL! LEQ 8 ( + call robocopy.exe "%%~A" %PROJECT_OUTPUT_PATH% /S /E >nul + if !ERRORLEVEL! LEQ 8 ( goto StageResistRelOk ) ) @@ -32,9 +41,16 @@ if %ERRORLEVEL% GTR 8 ( echo Build project... msbuild %PROJECT_PATH% /p:Configuration=%PROJECT_CONFIGURATION% /p:Platform="x64" /p:OutDir=%PROJECT_OUTPUT_PATH% -if ERRORLEVEL 1 ( - echo Encountered error while building %PROJECT_PATH% , exiting.. - goto :EOF +if not "%PROJECT_OUTPUT_PATH%" == "%DEFAULT_OUTPUT_PATH%" ( + call robocopy.exe %PROJECT_OUTPUT_PATH% %DEFAULT_OUTPUT_PATH% /IS /E >nul + if %ERRORLEVEL% GTR 8 ( + echo Warning! Unable to copy binaries to %DEFAULT_OUTPUT_PATH% + exit /b 1 + ) + else + ( + exit /b 0 + ) ) goto :EOF diff --git a/Dockerfile.windows-amd64 b/Dockerfile.windows-amd64 index ee31b22..2f399ff 100644 --- a/Dockerfile.windows-amd64 +++ b/Dockerfile.windows-amd64 @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/windows/nanoserver:1809 ARG binPath WORKDIR "c:\app" -COPY $binPath ./ -ENTRYPOINT ["SampleModule.exe"] \ No newline at end of file +COPY iotedgeoutput/bin ./ + +ENTRYPOINT ["IotEdgeModule1.exe"] \ No newline at end of file