How to Build and Deploy .NET Projects
This article will guide you through the process of introducing the Continuous Deployment approach to your .NET projects with Buddy and help you automate build and delivery activities.
In this guide, we’re using a C# website as an example, but you can use any .NET project as well.
Why you should actually read this guide
You know for sure the Agile approach, which aims to reduce the development cycle time to minimum. The reason for that is obvious: the faster the software moves to the next stage of the development process, the faster you get the feedback and are able to deliver the improved version. With Buddy you can streamline the whole process to a single push to the repository. Read on to learn how.
The basic idea behind Buddy
Setting up a project and a Git repository
Working in Buddy is based on projects which are basically Git repositories with delivery pipelines attached. Let's set up a project for your C# application and initialize the Git repository for that project.
Version control like Git it the very basis of the Continuous Delivery approach. If you're not familiar with the concept, check our beginner's guide to Git.
Create the project
To create a new project:
- Sign up at https://buddy.works with your Git provider or email address.
- Choose your Git provider.
- Select the repository with your .NET project.
If you wish, you can use Buddy to host your code. The service offers a fully-featured Git hosting with merge requests and push permissions
Build the pipeline
A pipeline is a set of actions, executed automatically in the given order, and under the conditions defined by you. Let's use it to introduce Continuous Delivery to your C# workflow:
- Click Add a new pipeline and enter the name of the pipeline.
- Enter the name of the pipeline, set the Trigger mode to On every push, and assign it to the branch that you want to deploy:
Configure the build action
Buddy uses isolated Docker containers for builds. They are essentialy virtual machines with preconfigured dev environments (frameworks, dependencies, databases, etc.) To build the C# application we’ll use Mono, a cross-platform .NET framework.
You can read more about the concept of Docker containers in our guide on Docker basics.
- Select .NET from the list of actions.
- Enter your tasks in the command field. You can install missing dependencies in the Environment tab.
Once you add the action, Buddy will automatically build your application on every push to the selected branch.
Configure the delivery
Your application is ready for the delivery. With Buddy, you can deploy both to FTP/SFTP server as well cloud services like Azure, AWS, Google or Heroku.
In this case we’ll use a simple FTP:
- Switch to the Actions tab of your pipeline and click +.
- Select the FTP action and enter the details of your server.
You can use environment variables to hide sensitive data.
Adding Delivery Action
Buddy will check write permissions on your server by sending and removing a test file. If everything is correct, the action will be added to the pipeline.
Run the Pipeline
With the pipeline configured, let's check how it all works. Make a push to the repository or click Run pipeline in the right column:
From now on, Buddy will automatically build and deploy your app on every push to the selected branch.
- On the first execution, Buddy will deploy all files from scratch (unless you set a specific revision on the server). From then on, only changed files will be deployed, which will significantly reduce the deployment time
- The same applies to the build: on the first execution, Buddy will download and install all dependencies. With everything in place, the following builds will take much shorter to execute.
Customer Success Manager
With Buddy even the most complicated CI/CD workflows take minutes to create
Sign up for Buddy CI/CDStart a free trial
Trusted by customers from 170+ countries