Update live website from button?
I have this idea which I'm not really sure how to implement.
The idea would be that we have a given product implemented in various sites, and the product itself would have a page with a button (let's say it's www.site.开发者_运维百科com/update) and once you click the button the site goes offline and retrieves the latest version of itself from an online repository (or something similar), is this doable?
are there any corner-cases I should be aware of when developing this feature?
Edit: maybe a more rational solution would be to build / use an app that updates multiple sites at once, instead of letting sites update themselves?
Well some of this depends on your environment. It is easy to execute a process from ASP.NET if you have control of your environment and all of that. So you could run some custom program or script, etc. Some things to consider are what happens if IIS fails to restart (if you even do that) or some error occurs; what should happen? And worse, what if the site just fails to come up but your script doesn't receive any kind of error - do you need a nanny process to force something to occur, etc. Also, you want to keep in mind the security around allowing the update to occur. Basically, it depends. :)
If I were developing something like this my instinct would be to have the update button mark a flag in a db or a file somewhere. Then have a separate app/process that monitors that flag and performs the update.
精彩评论