Closed anobaka closed 8 years ago
Have you tried the app_offline.htm file/feature? If you push a file with that name first it will cause the site to shut down.
@Tratcher Thank you for the answer! It works !
but I have to take one step more than old way:
old way(netframework 4 website): publish files to git repository and run git pull
in remote servers, it will be success because all files can be modified or repleaced without using the app_offline.htm file,
new way(asp.net core website): add app_offline.htm to git repository and run git pull
in remote servers, and after the content of app_offline.htm shows up on my browser(It takes a few seconds, is iis trying to stop running myweb.exe?), I remove app_offline.htm in my git repository and do what I do in old way
is there a better way to deploy my web projects to cluster servers? I'm using some features of asp.net core but using net452
framework in project.json
@shirhatti @glennc ?
Sounds like what you're trying is easily achievable by running a script that perhaps drop an app_offline.htm
page before performing a git pull
. Perhaps just carry a deployment script along with your published project and execute that instead of a git pull
.
Unless, of course I misunderstood and your git server is your deployment server. In that case, I'd recommend using a server-side git hook.
If you are not set on using git
as your deployment technology, you could perhaps use something that works better with app_offline.htm
. For one, I know that WebDeploy supports app_offline.htm
, you just have to use the enableRule:AppOffline
parameter.
@shirhatti Thanks ! I'm setting on using jenkins and msdeploy to do that.
Our company used to use git to publish websites(.net 4, mvc 3) to remote cluster by targeting website folder to git folder on servers. After I upgraded a project to asp.net core and published it to iis, the web files can not be updated by git because there is always some files(e.g. myweb.exe, myweb.dll) are in use, so the old 'git publish' way can not be modify these files. There are plenty of works to do by using vs's webdeploy to every server machine and it's lack of some functions like 'rollback', any suggestions? Thanks.