How to Deploy .NET Project on the AppHarbor

This article explains the basics of using AppHarbor. In this article, I’ll use the .NET SDK Samples project to show how to deploy a .NET project on AppHarbor.

Requirements

  • .NET project
  • App account
  • GitHub

Preparing

First of all, we need a AppHarbor account. If you don’t have one yet, please create one. Registration on AppHarbor is similar to any other site: sign up from the AppHarbor home page by clicking the Sign up button.
Ok now we have AppHarbor account and we are ready to deploy.

  1. Clone the GroupDocs GitHub repository containing the .NET SDK.
  2. Create an empty folder anywhere on your local machine. Name it groupdocs-dotnet-samples.
  3. Go to the folder with the cloned repository and then to the examples folder. Here you can see some folders, one of them will be api-samples.
  4. Copy the content of the api-samplesfolder.

    Copying content from the api-samples folder

    Copying content from the api-samples folder

  5. Post the copied content to the empty folder created in step 2.

Preparation is complete. If you can’t wait and want to see the example working, you can go straight to GroupDocs .NET API Samples and see our samples at work.

Deploy to AppHarbor

  1. Login to AppHarbor. and go to Your Applications.

    The Your Applications link

    The Your Applications link

  2. Create a new application:
    1. Enter an application name.
    2. Choose United States or Europe.
    3. Click Create new.
      Creating a new application

      Creating a new application

  3. Open a console and cd to the folder that the project was copied to. It’s a groupdocs-dotnet-samples folder.
  4. Enter the command git init
  5. Then enter the command git add . (This adds all files.)
  6. Enter the command git commit -m "Initial commit"

    The result of steps 3, 4, 5 and 6 in the console

    The result of steps 3, 4, 5 and 6 in the console

  7. Go to Your Applicationsin AppHarbor and click on you application.

    Application panel

    Application panel

  8. Copy the URL of your application.
     

    Button for copying URL

    Button for copying URL

  9. Return to the console and, as a final step, enter the command git push [URL of the api you copied] master.
     

    Deploying to AppHarbor

    Deploying to AppHarbor

Running a Project on AppHarbour

After these steps, our local project is deployed on AppHarbor. Lets go to AppHarbor and run the project.

In Applications, we see the build status of the current commit. If it is Active, there is a link to run it.

Status of the current build and link to run API

Status of the current build and link to run API

That’s all, as easy as a piece of cake.

Share on FacebookTweet about this on TwitterShare on LinkedIn