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.
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.
Image loading...
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.
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.
Image loading...
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:
Image loading...
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.
- 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.
Image loading...
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.
Image loading...
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:
Image loading...
From now on, Buddy will automatically build and deploy your app on every push to the selected branch.
Note:
- 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.
Jarek Dylewski
Customer Support
A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.