New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate Umbraco installation #2789
Conversation
@ssougnez Thanks! We'll have to discuss at HQ if we want to implement this change like this, we'll get back to you! |
Just an update: Shannon is on holiday but he has ideas about this. Unfortunately for you the most important idea he has is: this is not the way to implement this feature.
For now I'll close this but we has a task for him to provide more feedback on the PR when he gets back from holidays! |
@ssougnez Sorry for the late reply, I totally forgot to post this response from @Shazwazza :-) ====
|
I see. Just for information, I made a blog post about that (https://anotherdevblog.com/2018/07/20/automate-umbraco-deployment-with-powershell/) where I explain how to bypass the installation/upgrade page with Powershell ;-) I'm using it for a while now and the whole script installs and configures a new site in half a minute. Cheers |
@ssougnez Ah, this takes me back 6 years where I wrote something similar in a batch script! ;-) |
Worth noting that Chauffeur has this built in too https://aaronpowell.github.io/Chauffeur/ |
That's weird... I thought that I checked this plugin and decided not to use it because it was paying but apparently it's not ^^ Maybe I mistook it for Courrier... I'll have a look at that, thanks @Shazwazza |
This, or something similar to this has come up in a Twitter conversation I started: https://twitter.com/sitereactor/status/1059716570367356928 To summarise, there is a use case where upgrades are done in one environment and all the file changes are checked in and this checked in version is released to different environments. In these cases the install could potentially run unattended in some way to complete the data migrations on the environments as it's released to them. Doing that there is a possibility for something to get missed as the installer steps are dynamically created. But IIRC this hasn't happened previously. |
Another side note - though I mentioned that to make this happen in a nicer way would be to make the AuthN/Z flexible: #2789 (comment) ... it would still be perfectly plausable to do an unattended install/upgrade from a command line or other service by authenticating with the AuthenticationController just like the back office does and using the resulting cookie to send up with the requests to the InstallerController. |
Prerequisites
Description
Why?
"Umbraco Cloud" is a great solution to automate "Umbraco" installation. However, this option is not always usable (for example, the client I'm currently working for prefers to keep all his data on premise). Therefore, it would be nice to have a way to fully automate an "Umbraco" installation.
Another reason would be that installation/upgrade are not always done by technical people. For example, in my case, deployments are handled by a team of random people following procedures so we try to automate them as much as possible to reduce the number of manual steps. The "Umbraco" configuration is a huge possibility for these people to mess up with the installation by entering incorrect data.
So far, almost everything can be automated:
However, one crucial step can't be automated:
The goal of this PR is to provide an Web API route to install/upgrade "Umbraco" without human interaction. This provides the ability to automate an "Umbraco" installation from A to Z.
How to use it?
The new routes are:
The "Install" route needs to be called with a specific payload:
This would instruct "Umbraco" to:
Of course, it is also possible to use another type of database, for example:
The route returns a 200 response if everything went correctly or throws an unauthorized exception in case of issue.
The "Upgrade" route also requires a payload such as:
As the user needs to be logged in to be able to start the upgrade.
How does it work?
I didn't reinvent the wheel to do this. After a quick investigation, I understood that the configuration mechanism consists in a specific Web API route called several times to execute all the required steps. of this installation. I guess this is done that way because some of these steps induce an app pool recycling.
Therefore, the idea is to mimic this mechanism but server side. Calling the "Install"/"Upgrade" route initializes a new "Setup", then call the existing routes to execute the steps just as the AngularJs service does. The overlapping recycling mechanism ensure that the call to the new routes won't be terminated until the whole process is done.