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 text
Firstly: it takes five minutes, the guide is free and chances are we can contribute to your current CI/CD workflow—we like to share the experience.
Secondly: if you’re not really familiar with CI/CD, we strongly advise that you take a closer look at the concept. 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 introduce and streamline the whole process to a single push to the repository. Read on to learn how.
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, you can learn about its basics here.
Create the project
To create a new project:
- Sign up at Buddy.Works with your GitHub/Bitbucket profile 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. You can learn more about the features here.
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 in this guide.
- Select .NET from the list of actions.
- Enter your tasks in the command field. You can install missing dependencies in the Packages & Setup 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.
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.
This is just a brief summary of what Buddy offers regarding version control, development, and Continuous Deployment. You can check out other use cases for Buddy in the other guides, or drop a line to email@example.com.
Thanks for reading!