Do not use build arg to support Azure Pipeline

This commit is contained in:
rentu 2019-06-20 06:26:14 +01:00
Родитель c65a758f2e
Коммит cd5ec06528
2 изменённых файлов: 25 добавлений и 8 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -3,6 +3,7 @@ FROM mcr.microsoft.com/windows/nanoserver:1809
ARG binPath
WORKDIR "c:\app"
COPY $binPath ./
ENTRYPOINT ["SampleModule.exe"]
COPY iotedgeoutput/bin ./
ENTRYPOINT ["IotEdgeModule1.exe"]