Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for using app_offline with webdeploy

When I deploy my web site I need to:

  • Take the site offline.

  • run sql to update the database.

  • update the web site.

  • Put the site back online

I would like to script as much of this as possible without have to go the server and make manual changes.

I am currently using WebDeploy to push my website changes. It works great, and I don't have to know exactly where my site is installed on the server.

So what is the best way to put up/take down the app_offline file? If have seen some solutions where you rename an existing file ( app_offline.htm_ ) using an msbuild script. But it seems like that would require me to know the location of this file.

Is there a way to do this through web_deploy?

Thanks

like image 764
RMK Avatar asked Oct 24 '11 21:10

RMK


1 Answers

Yes, you can enable AppOffline during a WebDeploy deployment you can even customize the AppOffline template:

msdeploy.exe -verb:sync -source:iisApp=sourceApp -dest:iisApp=destApp,appOfflineTemplate="offlineTemplate.htm" -enablerule:AppOffline

https://blogs.iis.net/msdeploy/webdeploy-3-5-rtw

like image 53
chief7 Avatar answered Sep 28 '22 10:09

chief7