Skip to content

Commit

Permalink
updates to do dotnetcore csproj builds on azure
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysurma committed Apr 10, 2017
1 parent c4c2aee commit 1503f8b
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions deploy.cmd
Expand Up @@ -67,8 +67,14 @@ SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
echo Handling ASP.NET Core Web Application deployment.

:: 1. Restore nuget packages
echo Restoring nuget packages for all project.json projects
call :ExecuteCmd nuget.exe restore -packagesavemode nuspec
echo Restoring nuget packages for all projects individually
call :ExecuteCmd dotnet restore AllReadyApp\AllReady.Core\AllReady.Core.csproj
IF !ERRORLEVEL! NEQ 0 goto error

call :ExecuteCmd dotnet restore AllReadyApp\Web-App\AllReady\AllReady.csproj
IF !ERRORLEVEL! NEQ 0 goto error

call :ExecuteCmd dotnet restore AllReadyApp\AllReady.NotificationsWebJob\AllReady.NotificationsWebJob.csproj
IF !ERRORLEVEL! NEQ 0 goto error

:: 2a. Build
Expand All @@ -78,19 +84,23 @@ call :ExecuteCmd PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Co
echo Moving In to AllReadyApp Directory
pushd "%DEPLOYMENT_SOURCE%\AllReadyApp"

echo Building AllReady.Core Project (project.json)
call :ExecuteCmd dotnet build "%DEPLOYMENT_SOURCE%\AllReadyApp\AllReady.Core\project.json" --configuration Debug
echo Building AllReady.Core Project
call :ExecuteCmd dotnet build AllReady.Core\AllReady.Core.csproj

IF !ERRORLEVEL! NEQ 0 goto error

echo Not Building AllReady Project (it gets built with publish command)

echo Building Web Jobs Project (project.json)
call :ExecuteCmd dotnet build "%DEPLOYMENT_SOURCE%\AllReadyApp\AllReady.NotificationsWebJob\project.json" --configuration Debug
echo Building Web Jobs Project
call :ExecuteCmd dotnet build AllReady.NotificationsWebJob\AllReady.NotificationsWebJob.csproj
IF !ERRORLEVEL! NEQ 0 goto error

:: 2b. Publish AllReady
echo Publishing Allready Project (project.json) which includes building it
call :ExecuteCmd dotnet publish "%DEPLOYMENT_SOURCE%\AllReadyApp\Web-App\AllReady" --output "%DEPLOYMENT_TEMP%" --configuration Debug
call :ExecuteCmd dotnet publish Web-App\AllReady\AllReady.csproj --output "%DEPLOYMENT_TEMP%"
IF !ERRORLEVEL! NEQ 0 goto error

:: 2c. Publish version.json change
copy "%DEPLOYMENT_SOURCE%\AllReadyApp\Web-App\AllReady\version.json" "%DEPLOYMENT_TEMP%\version.json" /y
IF !ERRORLEVEL! NEQ 0 goto error

Expand All @@ -100,7 +110,10 @@ popd
:: 2c. Publish WebJobs (AllReady.NotificationsWebJob)
echo Publishing AllReady.NotificationsWebJob WebJob
call :ExecuteCmd mkdir "%DEPLOYMENT_TEMP%\app_data\jobs\continuous\notificationsprocessor\"
IF !ERRORLEVEL! NEQ 0 goto error

call :ExecuteCmd xcopy /S "%DEPLOYMENT_SOURCE%\AllReadyApp\AllReady.NotificationsWebJob\bin\debug\net46\win7-x86" "%DEPLOYMENT_TEMP%\app_data\jobs\continuous\notificationsprocessor\"
IF !ERRORLEVEL! NEQ 0 goto error


:: 3. KuduSync
Expand Down Expand Up @@ -132,4 +145,4 @@ exit /b 1

:end
endlocal
echo Finished successfully.
echo Finished successfully.

0 comments on commit 1503f8b

Please sign in to comment.