Deploying upgrade from 10 to 13 on Umbraco Cloud
# help-with-umbraco
c
Good morning. I have my first v10 to v13 upgrade for a cloud project today. I've done all of it locally and it works great. I just need to deploy it to Cloud now. Do I still need to delete the bin, obj and NuCache folders on cloud like i did locally and if I do, when do I do it timingwise?
s
I'll answer here as well for a public record: As far as I know you just push, Cloud should take care of the rest. https://docs.umbraco.com/umbraco-cloud/product-upgrades/major-upgrades#upgrading-from-umbraco-10 Don't forget to set the .NET version in the advanced settings of your cloud site. https://cdn.discordapp.com/attachments/1227534237515780177/1227535364080668722/image.png?ex=6628c265&is=66164d65&hm=b760a080b1cf8a14780d0022e181098e6e3a94dd145465a78993cfc4b2b7e2a0&
Also note the warning that says: > From v13,
Umbraco.Deploy.Forms
package has been replaced with
Umbraco.Forms.Deploy
package.
s
I would at least delete the dlls. The deployment doesn't delete unnecessary dlls for you, and you might end up having a site that wont start because, it fails loading a dll, that is still on the disk, but not needed for the site.
s
That's what a test deploy to the development environment can reveal! I am not so sure it doesn't delete dlls though 🤔
c
Thanks @skttl ,
When would you do the delete?
We can't stop the site
We can restart it
We have CI/CD setup with azure devops. I've just triggered the deployment. If I get an error, I will try and delete the dlls and trigger another deployment. I will report back here to let you know.
s
So my usual workflow, upgrade and deploy, site breaks, panic arrives. I delete all dlls and redeploy. Site works again 🙂
m
Interesting thread.. I thought https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/umbraco-cicd would mean a build process on the Umbraco Cloud Service and that would include a
dotnet clean
to explicitly avoid the lingering dll issues that you seem to be mentioning?
Does that also mean files stored in app_plugins (rather than as embeded resources) would also not be cleaned (if a delete occurs) ??
(or by deploy in this context are we talking
commits made directly to the Umbraco-git-repos
) ??
s
I'm talking about pushing stuff to the master branch on an Umbraco Cloud project.
m
If so then could you leverage the Kudu rest Api to run a predeploy
dotnet clean
and anyother cleaning tasks that might be required?
s
And depending on the default deploy mechanism that is running when pushing
c
I'm currently going down this route. First deploy failed. I deleted all the dlls. Second deploy failed, I deleted the deployment lock. Currently on third deploy.
m
Hijacking this thread a little more.. with umbraco only comitting to maintaining the master branch... is there a consensus on the approach for bestpractice setup for distributed teams that require develop, feature etc branches? mirror repository?
s
not sure what the question is? with the ci/cd setup you have everything in your own git repository and can make as many branch as you'd like. merging to main branch triggers deploy to cloud (but you can set any other trigger you want as well).
m
@Sebastiaan so this thread is committing straight to the master cloud repo (not the ci/cd flow) so was wondering if with a distributed team how others are keeping branches other than master safely?
s
We released the CI/CD features a few weeks ago for exactly that scenario: https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/umbraco-cicd
Probably misunderstanding something, you can set up the CI/CD flow on existing cloud sites as well.
I would say that is the best practice from now on 😅
c
@Mike Chambers We've been using the CI/CD capability of Umbraco Cloud for about 3-4 months now. We have our own git repository in Azure DevOps, we have separate branches for dev and main and feature branches etc. We trigger a deploy to Cloud every time we merge to dev, and every PR checks to make sure that we are in sync with the cloud repo to make sure changes weren't made there directly in the meantime (e.g. auto upgrade).
Just to let you all know, deleting the dlls solved the issue, the site was able to run once it deployed again after the dlls were deleted
m
@CodeSharePaul but you say you are having difficulties with lingering dlls, still with this approach? so no dotnet clean as part of CI/CD flow
also would seem that CI/CD flow is missing some sort of predeploy/postdeploy actions that we could hook into?
azure delpoyments allow for your own deploy.cmd too.. guessing that cloud being azuremight use this?
s
It's a zip deploy that's being triggered, can't really say how that one works (though both my Test.dll and the test plugin in App_Plugins got removed just fine after I removed them locally).
m
Test.dll in the repo?
s
I was testing if removing references (or removing nuget packages) would remove them on the server too.
no deploy.cmd.. we have custom api endpoints as we need to do some more umbraco-specific stuff
m
sounds like one of your excellent blog posts is in the offing? 😉 I think that's where I'm struggling at the moment with the ci/cd flow how do you keep your own version of the cloud repo up to date with umbraco cloud repo.
as they are detached?
c
its pretty cool how it works, we deploy several times a day, all from DevOps
s
Just ran a v10 to v13 upgrade myself (through CI/CD flow) and I can't say I have the same experience, all the dll that needed to be there were there, no stray ones. Of course things happen so I've be curious which ones were causing trouble. Probably too late since you already deleted them @CodeSharePaul?
m
"every PR checks to make sure that we are in sync with the cloud repo to make sure changes weren't made there directly in the meantime (e.g. auto upgrade)." I can't see in the https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/umbraco-cicd how that's covered?
mirror repos or clever usage of --set-upstream-to ?
s
There's no mirroring, one of the steps in the predefined scripts (as seen above) is to check if there's any changes in the cloud git repo that need to be pull into your GitHub (or other hosting) repo. So it's just doing a git pull from the Cloud repo into your hosted repo.
Not exactly, as it does it through a REST API, but that's how I imagine it in my head basically
m
but day to day I'm working against my version of the cloud repo.. how do I pull changes from the cloud repo into my version of the repo? (not part of a ci/cd flow deployment?)
well, I don't really know why you should/would as nothing should change on these environments (you're encouraged not to do doctype updates on remotes) - but if you really need to then it's just a git repo you can pull from https://cdn.discordapp.com/attachments/1227534237515780177/1227597501100724406/image.png?ex=6628fc43&is=66168743&hm=fd3db7ce565f356063a081bafea9667034be7e6d21067506457e27ad6674791d&
of course yes we meddle sometimes for auto-upgrades 🙂
m
s
Ah but since it's not mirrored, that's not true.. fair enough, they are 2 different git repost
m
orange is our team repo on githb, green would be cloud reop.. and grey each local repo of the team
s
I think a github action to do the sync above (manually triggered) would be of help to you.
m
how to sync// orange and green.. 🙂
and then git pull locally
m
ok must be missing something still then as the process says you pull the source files into storage on umbraco cloud and work on them.. not that you are working against the remote our git repo?
Thanks for all the input will have to play with this somemore.. 🙂
s
we don't do anything to your hosted git repo until you ask us to, we only make changes in the Cloud hosted one and then it's on you to get the diff into your hosted git repo (the example scripts set this up for you).
m
s
@CodeSharePaul what is your experience on deploy times from the CI/CD flow? We demoed it before the release, but was unhappy with how long it took deploying. Basically because it would spend time to restore nuget packages, build and test on devops, and then push to cloud, which would then spend time to restore nuget packages, build and deploy on cloud.
we've started experimenting with rolling our own, utilising kudu to handle the deployment from devops straight to the cloud app service.
c
@skttl it takes on average around 18 mins, but with it being handled by devops, you can just move on and leave it to do its thing
as opposed to when you commit directly on cloud and you are stuck having to wait for the build and deploy to finish before you can continue
m
"18mins"!! wow...
Not the fastest but it's never been an issue for us
s
hacker tip
- in Kudu you can change the post-receive git hook (in /site/repository/.git) and make it not run the deploy command on every receive. Then you can either modify to only run on a specific branch, or make it not run at all. If not running at all, you can set a PUT request to [yoursite].scm.euwest01.umbraco.io/api/deployments (authenticate with your normal cloud credentials) to trigger the deployment 🙂
the kudu api has a lot of nice little tools. You can even trigger a deployment from a git repository outside of cloud, but then you are going to miss all the commits that Cloud does itself (eg. autoupgrades)
m
https://$[yoursite].scm.euwest01.umbraco.io/api/command
is one of those.. with a Comand-Kudu function to wrap the authheader...
Copy code
# clean the uSync Folder (as no deletes only updates on deploy)
Write-Host "Remove site\wwwroot\uSync\v9"
Command-Kudu -command "powershell(rm -r -fo v9)" -dir "site\wwwroot\uSync"
# re-add the v9 folder
Write-Host "Re-add empty site\wwwroot\uSync\v9"
Command-Kudu -command "mkdir v9" -dir "site\wwwroot\uSync"
# use uSync.once to import
Write-Host "Adding site\wwwroot\uSync\v9\uSync.once"
Command-Kudu -command "echo uSync.once > uSync.once" -dir "site\wwwroot\uSync\v9\"
# clean the dtgeManifests
Write-Host "Cleaning the dtgeManifests folder site\wwwroot\App_Plugins\TSD\DtgeManifests"
Command-Kudu -command "powershell(rm -r -fo DtgeManifests)" -dir "site\wwwroot\App_Plugins\DTGEManifests\"
though sample obv not for cloud.. as that would be Umb Deploy 😉
m
https://$[yoursite].scm.euwest01.umbraco.io/dev for vs code 🙂
s
you sure? Just tried a couple of my projects, both got
"No route registered for '/code'"
m
/dev not code
If not try /dev/wwwroot
c
/dev works for me
44 Views