Merge pull request #1 from Azure/do-not-use-build-arg

Do not use build arg to support Azure Pipeline
This commit is contained in:
Renlong Tu 2019-06-21 13:19:14 +08:00 коммит произвёл GitHub
Родитель c65a758f2e 25ec8a387c
Коммит b059bf652d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 27 добавлений и 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\bin\iotedgeoutput"
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

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

@ -1,8 +1,11 @@
# escape=`
FROM mcr.microsoft.com/windows/nanoserver:1809
# Keep this argument to keep backward compatibility and avoid warning messages when build
ARG binPath
WORKDIR "c:\app"
COPY $binPath ./
ENTRYPOINT ["SampleModule.exe"]
COPY bin/iotedgeoutput ./
ENTRYPOINT ["IotEdgeModule1.exe"]