How to automate Umbraco deployment using Courier 2 - c#

Our team use Umbraco 7 as our CMS. We have a simple MVC web site and two main environments; TEST and PROD. Each environment has it's own Umbraco installation and database.
I've been tasked with setting up an automated deployment process, which simply involves taking all content, media and settings from our TEST Umbraco and installing it on our production environment. This process is to be triggered by the click of a button from Octopos deploy (which in turn would call a c# program which would handle the actual deployment by calling the necessary Umbraco APIs and plugins).
As my deployment tool, I've decided to use Courier 2. I'm using the trial edition to sync between two sites I've set up locally (UmbracoA.local and UmbracoB.local). I've managed to, using the Courier 2 interface in Backoffice, create a revision on UmbracoA, transfer it to UmbracoB and install it there manually.
Now I must figure out a way to call the Courier 2 API and trigger these steps automatically. (No user should at any point have to use Backoffice to finalize any process of the deployment).
Steps to be automated are:
The creation of a revision including all content on Umbraco site A
Transfer of said revision to Umbraco site B
Install of said revision on Umbraco site B
From what I understand, Courier 2 has a event model to which I can hook my own steps, but I'm simply interested in triggering Courier 2's native events of creating a revision and pushing & installing it on the second site. Surely, this must be a rather simple call to their API?
As you can imagine, I'm fairly new to both Umbraco and Courier 2, but essentially what I'm looking for is just a code example of how I might call the events to trigger this process.
Thanks in advance and let me know if I can supply any more info about my scenario that might help you answer my question!!
Extra info: - Umbraco version 7.5.4 - Courier version 2.52.15

Related

Removing Unused ASPX pages from ASP.NET Forms Project

Clean Up question: I am working on a large ASP.NET FORM 4.0+ project where there are many legacy pages.
Before I start a timely process of elimination. I wanted to reach out to determine any extensions in Visual Studio that can analyze unused or not referenced, or not linked to any web page report anymore.
Another thought is I do have about 6 months of IIS logs I could run web traffic reports remove any page not showing up in the reports.
Share your wisdom please, the project is over 5000 asp.net pages
Primary reasons for cleanup:
- Project will build much faster..
- Allow adding other developers to the project will be sanitized..
I wanted to reach out to determine any extensions in Visual Studio
that can analyze unused or not referenced, or not linked to any web
page report anymore.
After a long research, there is no such vs extension for VS2019 to remove any used aspx pages so far.
But there is an extension called FindUnusedFiles which applies to VS2015 or earlier version. It has not been updated to use in VS2017+. So as a suggestion, you can write a review under Rating & Review in this link. Try to contact with the author to apply it in VS2019.
Besides,I recommend you could post a feature request in our User Voice forum(DC)----suggest a feature to share your idea with the staff to add the function into VS2019.
After you post it, you could share the link in this thread and anyone who is interested in this including us will vote it to get the attention of Microsoft as soon as possible.
Hope it could help you.

Finding Webservice and DLL reference in .NET WebSites(NOT WebApps)

We are having more than 40 websites (Not Web Apps) developed many years ago.
We are planning to migrate these websites into Web Apps and also we need to remove old web services and DLL.
First step, we need to find all Web Service and DLL references in these Web Sites.
It should display list of pages web service/DLL methods being referred, list of line where they are used, input , output parameters. etc.
I am looking for the following list.
Component - Name of Webservice/DLL Component
Sub-Component - Methods used in the Component
Input Parameters - List of Input parameters
Output Parameters - List of Output parameters
Module - What is calling the component - Example : Registration page, User Login, Product Registration
Which page is being called - Name of ASPX page - Example - Login.aspx.
I can use Re-sharper going to each web sites and find the references of each web services/DLL and its methods. But the issue is number of web sites are huge. we don't want to spend time on doing manual work. Also web sites are not Web Apps. So it is not compiled one.
Got a code which is using reflection to find list of methods used inside the DLLs (This). My need is just opposite to that .
This is similar to the "Find all references" functionality in Visual Studio with more details.
Do we have any tools to do this task?
We can use .NET Compiler Platform called "Roslyn" -
https://github.com/dotnet/roslyn
Roslyn provides open-source C# and Visual Basic compilers with rich
code analysis APIs. It enables building code analysis tools with the
same APIs that are used by Visual Studio.
Of course, it is not straight forward but it would reduce the manual work.
https://joshvarty.wordpress.com/learn-roslyn-now/ - This was interesting to start with.

Duplicate an Umbraco site to another account

Is it possible to duplicate a live Umbraco site which we have full access to (Backoffice, passwords etc.) and copy its content into another account? The idea is that we want a clone of the live site to practice on without danger of changing something and accidentally ruining the currently working and published live site.
To simplify, we have:
A working live Umbraco site with admin privileges so we can access all files.
A new, separate Umbraco account which is essentially a blank canvas with access to all files.
We would like to duplicate all the files and content from the live site to the new account just to have something that closely resembles the live site to practice building widgets etc.
We are working in Visual Studio 2012 with C# and Razor and want to use the latest version of Umbraco CMS (currently 7.3.0-beta Prerelease according to NuGet Package Manager).
Have I got the right idea with this approach or is there a better way? I am aware of Umbraco Courier but would like to know if there are any options other than a paid-for add-on.
If this is the best approach, what is the procedure, and if not, what are the options and why are they preferable?
This can be achieved quite easily by copying the files to a new environment, restoring a backup of the database to a new environment and then updating the connection string in the web.config. This will give you a working copy of the live site. If you are looking for a continuously synchronised solution then that is a different matter, Courier has never worked for me reliably.

Editing Documents (.doc) in Browsers

I've been developing a web application with asp.net webforms and in this app I have some documents (.doc, .docx, .rtf files), and my client want to edit these files on browser, they want to open a document in an editor, edit, save it on server (without downloading) and close it. I know it's difficult but I would like to know if it's possible or if is there any easy way to do it. We find something like SkyDrive of Microsoft.
PS: We can pay for components if you can suggest something that really works.
Thank you!
IF the clients have Office installed:
I would recommend http://www.webdavsystem.com/server - this allows you to build a "virtual filesystem" (WebDAV which is based on HTTP) which Office can access thus allowing the client to open/edit/save a document (DOCX etc.) via HTTP(S)... it is pure .NET, integrates nicely with ASP.NET and has even a JavaScript accessible API... esp. the upcoming V 3 comes with a wizard which allows you easily to add that funcionality to your ASP.NET application... (just a happy customer, not affilliated).
IF the clients don't have Office installed then it gets tricky:
To really fully support you would need some sort of Silverlight/Flash/ActiveX/JavaApplet which runs in the clients browser and supports the needed editing features...
I am not aware of such production-quality components except the ones from Microsoft - see http://www.microsoft.com/en-us/office365/online-software.aspx
You could integrate them into your web application although they won't offer the full Office feature set in the browser...

Add A "Check for Updates" Option

I would like to know, how to check for updates for my own developed software. I mean when a user uses the program and clicks on check for updates, what should I do and how to download the new application? Is it parsing the website download page, or using a database?
I would like to know how to achieve this in both C++ and C#.
There are quite literally 100's of different ways of doing this. So you need to put a little more thought into what your application platform/architecture is capable of (i.e. do you have net access, what is the technical level of your typical user etc). As examples of a solutions:
At startup your app checks a webservice for the latest version number and then compares to the current install. If the version is different then the user has an option to download and install the newer version. This could be done by either getting the use to go to a specific web address or you could download and execute it for them.
You also have the option of using something called Clickonce, this will effectively handle all this for you. This is a big subject so Google is your friend on this one, but as a starter have a look at:
http://msdn.microsoft.com/en-us/library/t71a733d%28VS.80%29.aspx

Categories