32 lines
1.6 KiB
XML
32 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project>
|
|
<PropertyGroup>
|
|
<DeleteExistingFiles>false</DeleteExistingFiles>
|
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
|
<LaunchSiteAfterPublish>false</LaunchSiteAfterPublish>
|
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
|
<PublishProvider>FileSystem</PublishProvider>
|
|
<PublishUrl>C:\docker\web\</PublishUrl>
|
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
|
<_TargetId>Folder</_TargetId>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<SelfContained>false</SelfContained>
|
|
</PropertyGroup>
|
|
|
|
<!-- ① 発行開始前: app_offline.htm を配置して IIS のプロセスを停止し DLL ロックを解除 -->
|
|
<Target Name="TakeAppOffline" BeforeTargets="BeforePublish">
|
|
<Message Text="[Deploy] app_offline.htm を配置して IIS プロセスを停止します..." Importance="high" />
|
|
<WriteLinesToFile File="$(PublishUrl)app_offline.htm"
|
|
Lines="<html><body>Publishing updates...</body></html>"
|
|
Overwrite="true" />
|
|
<!-- プロセスが完全に終了してファイルロックが解放されるまで 2 秒待機 -->
|
|
<Exec Command="powershell -Command Start-Sleep -Seconds 2" />
|
|
</Target>
|
|
|
|
<!-- ② 発行完了後: app_offline.htm を削除して IIS プロセスを自動起動 -->
|
|
<Target Name="BringAppOnline" AfterTargets="AfterPublish">
|
|
<Message Text="[Deploy] app_offline.htm を削除して IIS アプリケーションを復帰します..." Importance="high" />
|
|
<Delete Files="$(PublishUrl)app_offline.htm" />
|
|
</Target>
|
|
</Project> |