-
Notifications
You must be signed in to change notification settings - Fork 6
/
Publish.cmd
193 lines (138 loc) · 13.1 KB
/
Publish.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
dotnet restore tools\NuGet\NuGet.csproj
if errorlevel 1 GOTO ERROR
%userprofile%\.nuget\packages\nuget.commandline\4.1.0\tools\nuget.exe restore
REM Build
msbuild AspNetPublishSamples.sln
if errorlevel 1 GOTO ERROR
REM File System Publish (Used by Kudu)
REM Syntax:
:: msbuild projectname.csproj
:: /p:PublishUrl="<destination path>"
:: /p:DeployOnBuild=true
:: /p:Configuration=Release
:: /p:WebPublishMethod=FileSystem
:: /p:DeployTarget=WebPublish
:: /p:AutoParameterizationWebConfigConnectionStrings=false
:: /p:SolutionDir="."
:: Only for WebJobs on DotNet Core Project System
:: /p:IsWebJobProject=true
:: /p:WebJobName=<WebJobName>
:: /p:WebJobType==<Continuous|Triggered>
REM Testing the commandline for all Project types.
:: =========== ASP.Net Core ===============
REM ASP.NET Core on Core
msbuild ASPNetCore\ASPNetCore.csproj /p:PublishUrl="..\PublishOutput\ASPNetCore" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM ASP.NET Core on NetFx
msbuild ASPNetCoreFullFramework\ASPNetCoreFullFramework.csproj /p:PublishUrl="..\PublishOutput\ASPNetCoreFullFramework" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== ASP.Net Classic ===============
REM Classic MVC5
msbuild MvcApp\MvcApp.csproj /p:PublishUrl="..\PublishOutput\MvcApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Single Page Application
msbuild Spa\Spa.csproj /p:PublishUrl="..\PublishOutput\Spa" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Web API
msbuild WebApiApp\WebApiApp.csproj /p:PublishUrl="..\PublishOutput\WebApiApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Web Forms
msbuild WebFormsApp\WebFormsApp.csproj /p:PublishUrl="..\PublishOutput\WebFormsApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebSite ===============
REM ASP.NET Razor 3 Web Site.
msbuild AspNetRazor3WebSite\website.publishproj /p:PublishUrl="..\PublishOutput\AspNetRazor3WebSite" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebApp with WebJob ===============
REM WebApp With WebJob on classic project system.
msbuild WebAppWithWebJob\WebAppWithWebJob.csproj /p:PublishUrl="..\PublishOutput\WebAppWithWebJob" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM WebApp With WebJob on classic project system.
msbuild WebJobNetFx\WebJobNetFx.csproj /p:PublishUrl="..\PublishOutput\WebJobNetFx" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebJobs ===============
REM WebJobs (Net Fx) on classic project system.
msbuild WebJobFullFramework\WebJobFullFramework.csproj /p:PublishUrl="..\PublishOutput\WebJobFullFramework" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM WebJobs (DotNet Core) Portable
msbuild WebJobDotNetCorePortable\WebJobDotNetCorePortable.csproj /p:PublishUrl="..\PublishOutput\WebJobDotNetCorePortable" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCorePortable /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
REM WebJobs (DotNet Core) Standalone
msbuild WebJobDotNetCoreStandalone\WebJobDotNetCoreStandalone.csproj /p:PublishUrl="..\PublishOutput\WebJobDotNetCoreStandalone" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCoreStandalone /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
REM WebJobs (Net46) on DotNetCore Project System
msbuild WebJobDotNetCoreNetFx\WebJobDotNetCoreNetFx.csproj /p:PublishUrl="..\PublishOutput\WebJobDotNetCoreNetFx" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCoreNetFx /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
:: =========== Functions ===============
REM Function Apps.
msbuild FunctionApp\FunctionApp.csproj /p:PublishUrl="..\PublishOutput\FunctionApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM MSDeploy Package Publish(Used by TeamBuild)
REM Syntax:
:: msbuild projectname.csproj
:: /p:PackageLocation="<destination path>"
:: /p:DeployOnBuild=true
:: /p:Configuration=Release
:: /p:WebPublishMethod=Package
:: /p:DeployTarget=WebPublish
:: /p:PackageAsSingleFile=true
:: /p:AutoParameterizationWebConfigConnectionStrings=false
:: /p:SolutionDir="."
:: /p:DesktopBuildPackageLocation=<destination file with extension> (Only needed for ASP.NET Core projects using cli < 2.0. This is due to a bug which has been fixed in 2.0 cli)
:: /p:DeployIisAppPath=<Web site name> (Only needed for ASP.NET Core projects using cli < 2.0. This is due to a bug which has been fixed in 2.0 cli)
:: Only for WebJobs on DotNet Core Project System
:: /p:IsWebJobProject=true
:: /p:WebJobName=<WebJobName>
:: /p:WebJobType==<Continuous|Triggered>
set "RootPath=%~dp0"
REM ASP.NET Core on Core
:: =========== ASP.Net Core ===============
msbuild ASPNetCore\ASPNetCore.csproj /p:PackageLocation="..\PublishOutput\ZipASPNetCore" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:DesktopBuildPackageLocation="%RootPath%PublishOutput\ZipASPNetCore\ASPNetCore.zip"
if errorlevel 1 GOTO ERROR
REM ASP.NET Core on NetFx
msbuild ASPNetCoreFullFramework\ASPNetCoreFullFramework.csproj /p:PackageLocation="..\PublishOutput\ZipASPNetCoreFullFramework" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:DesktopBuildPackageLocation="%RootPath%PublishOutput\ZipASPNetCoreFullFramework\ASPNetCoreFullFramework.zip"
if errorlevel 1 GOTO ERROR
:: =========== ASP.Net Classic ===============
REM Classic MVC5
msbuild MvcApp\MvcApp.csproj /p:PackageLocation="..\PublishOutput\ZipMvcApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Single Page Application
msbuild Spa\Spa.csproj /p:PackageLocation="..\PublishOutput\ZipSpa" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Web API
msbuild WebApiApp\WebApiApp.csproj /p:PackageLocation="..\PublishOutput\ZipWebApiApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM Classic Web Forms
msbuild WebFormsApp\WebFormsApp.csproj /p:PackageLocation="..\PublishOutput\ZipWebFormsApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebSite ===============
REM ASP.NET Razor 3 Web Site.
msbuild AspNetRazor3WebSite\website.publishproj /p:PackageLocation="..\PublishOutput\ZipAspNetRazor3WebSite" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebApp with WebJob ===============
REM WebApp With WebJob On Full Framework.
msbuild WebAppWithWebJob\WebAppWithWebJob.csproj /p:PackageLocation="..\PublishOutput\ZipWebAppWithWebJob" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM WebJob Included with WebApp on Full Framework
msbuild WebJobNetFx\WebJobNetFx.csproj /p:PackageLocation="..\PublishOutput\ZipWebJobNetFx" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
:: =========== WebJobs ===============
REM WebJobs On Full Framework.
msbuild WebJobFullFramework\WebJobFullFramework.csproj /p:PackageLocation="..\PublishOutput\ZipWebJobFullFramework" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
if errorlevel 1 GOTO ERROR
REM WebJobs (DotNet Core) Portable
msbuild WebJobDotNetCorePortable\WebJobDotNetCorePortable.csproj /p:PackageLocation="..\PublishOutput\ZipWebJobDotNetCorePortable" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCorePortable /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
REM WebJobs (DotNet Core) Standalone
msbuild WebJobDotNetCoreStandalone\WebJobDotNetCoreStandalone.csproj /p:PackageLocation="..\PublishOutput\ZipWebJobDotNetCoreStandalone" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCoreStandalone /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
REM WebJobs (Net46) on DotNetCore Project System
msbuild WebJobDotNetCoreNetFx\WebJobDotNetCoreNetFx.csproj /p:PackageLocation="..\PublishOutput\ZipWebJobDotNetCoreNetFx" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:IsWebJobProject=true /p:WebJobName=WebJobDotNetCoreNetFx /p:WebJobType=Continuous
if errorlevel 1 GOTO ERROR
:: =========== Functions ===============
REM Function Apps.
msbuild FunctionApp\FunctionApp.csproj /p:PackageLocation="..\PublishOutput\ZipFunctionApp" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:DesktopBuildPackageLocation="%RootPath%PublishOutput\ZipFunctionApp\FunctionApp.zip"
if errorlevel 1 GOTO ERROR
:ERROR
endlocal
exit /b 1