Back to Top

Deploying Packages from ProGet to Servers using Hedgehog

ProGet is the central hub for your organization’s packaged applications and components. When used in conjunction with Hedgehog, these application packages can be deployed to your datacenters by creating a self-service deployment platform. This tutorial explains how to deploy a basic web application packaged as a Universal Package to a Windows server.


Prerequisites

This tutorial is also available as a video:

Create a Universal Feed

In ProGet, we will want to create a Universal Feed that will host the packages. Select "Feeds" > "Create New Feed" > enter "DeploymentPackages" as the feed name making sure to choose "Universal package format", and click "Create Feed":

Once created, we will be taken to the Manage Feed page. Select "DeploymentPackages" from the breadcrumb to view the Feed Overview page.

Upload the Accounts Website Package to ProGet

Once the feed is created, we will click "Add Package" > "Upload Package" and upload the Accounts.Web.upack file we downloaded previously. Once we click "Upload File", we should see the package appear in the list. Take note of the "API endpoint URL" for this feed as well, it will be used by Hedgehog to connect to ProGet:

You may click on "Accounts.Web 1.5.0" to view the package details, particularly the Deployments and Files tabs. While the Deployments tab doesn’t have anything currently, it will once a deployment with Hedgehog completes.

Under the Files tab, you’ll notice the packageVariables.json file, which when we preview it, we see the contents:

        {
            "GitCommitId": "edb81ea63cdd9c7cc7df8291258e67d0dee9c81f",
            "DeployStepsRequired": ["FullStop","ReloadCache"],
            "DebugBuild": "false"
        }     

This file contains variables that are injected into Hedgehog deployment plans, and may be used to control how the package is deployed. While we won't use these variables in this tutorial, they will be seen in later screenshots.

Connect Hedgehog to ProGet

Now that the package is uploaded, we can open up Hedgehog. The first step is to add a Package Source so that Hedgehog can pull packages from ProGet. Under the Admin gear, click on “Administration” > “Components & Extensibility” > “Package Sources” > “Create Package Source”.

From here, we’ll enter the API endpoint URL we noted previously from ProGet, then click “Save Package Source”:

Create a Project

Once the package source is added, we will create a new project in Hedgehog. Using the project dropdown, we will select “Create project…”

Entering “Accounts” as the project name, and leaving the initial pipeline values as their defaults.

Create a Deployment Set

With the Accounts project created, we will now create a Deployment Set that contains the Accounts.Web version 1.5.0 package. Under the “Packages” project sub-navigation, Hedgehog will automatically list the packages that are stored in the DeploymentPackages feed in ProGet. We will note that Accounts.Web 1.5.0 is in the list, and select “add to set”, followed by “Create Deployment Set”, leaving the default values, then click “Create Deployment Set” again:

Once created, we will see the Deployment Set Overview page that details any deployments, variables, and associated packages with the deployment set:

Modify the Deployment Plan

Once the deployment set is created, we will create a Deployment Plan that will perform the steps necessary to deploy the package. From the project sub-navigation menu, select “Plans” > “Deploy Accounts” to open the Plan Editor.

Click the topmost red X to remove the example plan, then add a General Block by dragging & dropping it from the statement library on the left:

Enter “Deploy Accounts” as the short description and click “Save”, then use the “Search Statements” box to find the “Ensure AppPool” operation, and drag-and-drop it into the newly added General block. This will present many properties familiar to IIS administrators. Enter the following values into the property editor:

Name: AccountsAppPool

.NET CLR version: v4.0

State: Stopped

Click Save. Now, we will add a “Deploy Package” operation that will be used to deploy the Accounts.Web package we associated earlier. Search for “package” in the Search Statements box, and drag-drop the operation under the “Ensure Application Pool” operation added previously. Enter “Accounts” as the package name, and “C:\Websites\Accounts” as the target directory:

Click Save, then add one more operation, the “Start App Pool” operation with “AccountsAppPool” as the application pool name.

Once those 3 operations are added, the resulting plan should look like the following:

Click “Save Plan”, and we are now ready to edit the auto-generated pipeline.

Modify the Pipeline

Pipelines describe the set of stages that a set of packages traverse through, along with any other process controls such as approvals, deployment windows, and more. Select “Pipelines” from the project sub-navigation menu, and the auto-generated “Accounts” pipeline should be visible:

Click the Accounts pipeline, and then “edit” under Integration to edit the target:

This will open the “Edit Pipeline Stage Target” window where we can set the server to “Specific servers…” and “localhost” as the target server:

Then click Save

Deploy the Package

Once the pipeline is saved, we will return to the Deployment Set details page under the “Packages” project sub-navigation menu, and the “Deployment Sets” tab:

From here, we will click “deploy” in the Integration box which opens the “Deploy Deployment Set” window:

One thing we notice is the “Accounts.Web” variables section, which contains the additional package information we noted earlier defined by the packageVariables.json file. We will leave the default values and click “Deploy”, which will effectively deploy the package contents to the specified directory.

Deployment Details in ProGet

If you browse back to the DeploymentPackages feed in ProGet and select the Accounts.Web 1.5.0 package, under the Deployments tab there will be some basic details about the deployment with a link back to the Deployment Set that initiated the package deployment:

Summary

With just a few simple operations in Hedgehog, we deployed a Universal Package from a newly created ProGet feed to an example server running IIS. While this tutorial describes a basic deployment scenario meant to introduce the process of coordinating products in the Inedo Suite, future tutorials will detail more advanced scenarios such as integrating with external services like GitHub.