Deploying a classic ASP site with Octopus - octopus-deploy

We are currently trying to integrate deploying our new ASP.NET projects with Octopus and I was wondering if anyone has tried to use Octopus to deploy a classic ASP site?
I know it is possible and I know how to do it in theory, but our problem arises from the fact that the ASP site is HUGE. After the total size of all the videos, images, and pdf's are summed up the site weighs in at just under 3 gigs. So when a change is checked into TeamCity and a NuGet package is created, Octopus will be pushing a 3 gig nuget package to 2 individual load balanced servers.
We can't create a shared directory or cdn for the media files (at least not yet) so can anyone tell me a good way to attack this? Or is Octopus just not a good solution for a large ASP site and Web Deploy would be better? If that is the case, how can a backup solution be implemented for Web Deploy so that any errors can be rolled back?
Thanks for the help on this in advance. We are converting these ASP sites to MVC but that is going to take a while and until that is done we have to find a way to work with them.

You should package the ASP site and the Media Files as 2 separate NuGet packages. This will allow you to update the ASP code and deploy it without having to deploy all the media files (assuming the code changes more often than the media).
Implementation Details
Setup TeamCity to package the ASP site and the Media files as separately published NuGet packages.
In Octopus Deploy add each of the 2 NuGet Packages as deployment steps for a single project
When you create a new Release in Octopus select the newest package version for the ASP code and the previously released package version for the media files.
When you deploy the release you can check a box to skip the deployment of the media files
Tips
Use the Octopus variable "OctopusWebSiteName" to specify that your media files package should be deployed in a sub-directory of your ASP site. (Like "Default Web Site/Media") The variable can be scoped to a specific package so that it only applies when deploying that package.

Do you really need to push all the content every time - cant you just push the changes?

Related

Create Visual Studio 2019 project from existing Azure Web App

I have a v7 Umbraco instance as a Web App on Azure but the machine the dev copy was on has been decommissioned and I need now to recreate the dev site in Visual Studio 2019, ideally cloning it from the live site in some way. I have created an empty project and, using the cloud explorer, downloaded the files from the app, but I am unclear whether I just copy them directly into the solution folder or into their own subfolder of the solution folder or whether simply copying them in will do the trick anyway as there's still the database to consider as well. I'm afraid I haven't used Visual Studio since creating this site three or so years ago and I seem to have forgotten most of what I did then anyway, so any help wpuld be greatly appreciated. The only advice I coud find via google was for older versions of VS and so not much help.
Recreating the original project from the live site is probably not going to be possible. It depends how and what you deployed to the live site.
It sounds like what you have is a working live site, but have lost access to the original source code. You should be able to copy the site and get it working elsewhere, but you're probably going to struggle to recreate the original development environment and amend the compiled elements of the website without access to the source code.
The Umbraco.com website has some great documentation on getting started and setting up Umbraco. Umbraco TV is great for getting up to speed quickly too. This should help explain the project structure. I suggest you create a blank Umbraco install to familiarise yourself with how Umbraco works(I wrote a post explaining how to do this with MS VS2015 here).
A typical deployment, using MS WebDeploy or FTP from Visual Studio, wouldn't deploy the project files or source-code for the compiled (.cs) elements of the website, these are usually kept as development files and checked in to source control.The live site probably only has the compiled versions of these file in the bin folder. The good news is the Razor template and view files(.cshtml) should be on the server.
However, if everything was uploaded (it happens) then you may have a chance, in which case you can download the files, potentially open the project and try to run the project locally on the development machine. There's no reason why you can't install an older version of MS Visual Studio alongside 2019 if there's an issue with that version. Although, I suspect this isn't an option since you felt the need to create a new empty project. If this is the case you might be able to add any project files to the the new empty project and attempt to recreate the project that way.
Regarding the database. You're going to need a copy or backup installed on a Microsoft SQL Server (unless you used MS SQL CE which is file based). You should be able to download a .bak file from the server if you're using Plesk or connect remotely using MS Management Studio if not, it depends on the host (Azure will allow access via MS Management Studio). Umbraco will need the connection string configured in it's web.config, the one you downloaded may be trying to connect to the live server so be careful.
Long shot ideas:
If you're really desperate you might be able to reverse engineer some of your compiled .dll using a tool like ILASM.exe but it's not going to be easy;
Perhaps you could reference the .dll in a the new project and it will all work auto-magically?! but I doubt this will work as there will be two application starting points and you'll probably get a runtime exception.

How can I automate builds and deployments with ASP.Net WebForms?

I have a web application created with ASP.Net WebForms and I would like to know some alternatives to automatize the builds and releases in live version without manual steps (as much as possible):
merge from test branch to main branch (TFS on-promise)
assembly info update (increase version number)
package creation
copy and paste files to live server
update the physical path of web site in IIS
notification emails with result

Publishing VS project to Github Pages

I have my project code on github here: https://github.com/mrdcs92/trip-planner
But when I try to reach the hosted project at https://mrdcs92.github.io/trip-planner/ , all I see is the readme file. Are there files that need to be in a different directory for the project to run on github pages? This is my first large project that I have done, so I'm not sure how to host this project correctly compared to my other existing projects that consist of just an index.html file.
GitHub pages can only host static content (as you said - "just an Index.html page").
What you have is a .NET Website. GitHub does not host these. You will need a Hosting provider who can host .NET Core 1.1 Websites.
I know Azure can do this, and has some level of free hosting, but you will have to google around for a hosting provider that meets your needs.
Usually you have a "Publish" setup from your Project to the Hosting Provider, if you are using a Build system, like VSTS, App Veyor, etc. you would have that publish the site, if not, you can use the option in Visual Studio.

VSTS Build Definitions for Solutions with multiple web projects

I have visual studio solution with 2 web projects. The source is in VSTS and the apps are hosted in Azure. I have build and release management setup to automatically deploy to Azure.
So every time I check in something, 2 releases are triggered, one for each web project. Is there any way I can separate the two? The web project should only trigger for a check in on that folder and the api trigger for a check in on that folder?
You just need to change Path filters for specific path of each web project path. More information, you can refer to Build definition triggers.

Missing bin folder in Nuget package

I am deploying asp.net web site via Octopus deploy. In TFS build definition I specified PowerShell script which pack and push Nuget package. Everything working working well except one thing: bin folder is not included in Nuget package.
When I tried to manually packing my web site into Nuget package I noticed that bin folder is included.
I supposed that something happened in TFS build process and bin folder is lost. But I cannot figure out how to solve this.
Any advice?
It sounds like you are trying to build a Website rather than a Web Application. Websites are only supported for legacy and don't get any love in the tooling. You can:
1) manually create your website layout for packaging with a post-build PowerShell script.
2) upgrade from a Website to a Web Application project and feel the love.
To upgrade you can create a new Web Application project in VS and delete all the specifics, like aspx files or other overwrites. Then drop the left over files on top of the Website, and open it in your solution. You will have two entries, one for site and one for app. Fix up the web app errors and build...

Resources