OpServer – Build Web Deploy package ( from command line)

Background

It is easy to build through the Visual Studio GUI.

But, one misses out on knowing what is happening behind the scene.

 

Script

Here is a command line DOS batch file that creates OPServer via MSBuild.exe.

Dos batch file


@echo off

setlocal

set "_dirMSBuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\"

set "_dirSource=extract\Opserver-master\"
set "_fileSolution=Opserver.sln"

set "_folderPackage=WebPublish"

rem package file system
set "_Option01=   /p:PackageLocation=%_folderPackage%  "

rem packaging options
set "_Option02=  /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true "

rem configuration options
set "Option03=  /p:Configuration=Release "

rem connection string
set "_Option04= /p:AutoParameterizationWebConfigConnectionStrings=false "

set "_packageOption=%_Option01% %_Option02% %_Option03% %_Option04%"

echo "Package Option is %_packageOption%"

"%_dirMSBuild%\msbuild.exe" %_dirSource%\%_fileSolution%    %_packageOption% 

endlocal

Build Log

Here is our msbuild log output captured using tee.exe


"Package Option is    /p:PackageLocation=WebPublish     /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true    /p:AutoParameterizationWebConfigConnectionStrings=false "
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Creating directory "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\".
GetMSDeployInstalledVersionPath:
  $(_DefaultMSDeployMaxVersion) is 3
  $(_MSDeployVersionsToTry) is 9.0
  $(MSDeployPath) is C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\
GenerateMsdeployManifestFiles:
  Generate source manifest file for Web Deploy package/publish ...
PackageUsingManifest:
  Packaging into C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.zip.
  Starting Web deployment task from source: manifest(C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.SourceManifest.xml) to 
  Destination: package(C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.zip).

  Adding declared parameter 'IIS Web Application Name'.
  Successfully executed Web deployment task.
  Package "Opserver.zip" is successfully created as single file at the following location:
  file:///C:/Downloads/StackExchange/OPServer/20180326/extract/Opserver-master/Opserver/WebPublish


Build succeeded.
    0 Warning(s)
    0 Error(s)

MvcBuildViews:
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v temp -p C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver 
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\Opserver.csproj" (default targets).
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)


Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\Opserver.csproj" (default targets).
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:48.33


Deploy Folder

Here is the deploy folder.

It is created under the folder specified in the packageLocation passed along to the msbuild executable.

Next

In subsequent posts we will touch on the troubles we ran into trying to deploy the past.

 

References

  1. vijayrkn
    • vijayrkn/ASPNetPublishSamples
      Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s