Automated build, test, and deployment of. Net core projects using BitBucket pipeline

Source: Internet
Author: User
Tags web hosting web hosting services bitbucket pipelines

1. Introduction

First, BitBucket provides web hosting services that support mercurial and GIT version control systems. In short, it is similar to GitHub, except that it allows individuals to create private project warehouses for free. In addition to this, BitBucket provides pipeline capabilities to help us automate the construction, testing, and deployment of our projects.

2. User Guide

The project is a template project for the. Net core version created using the ABP, with the following project structure:

Click Pipeline, we select. NET Core to create a configuration file for configuring pipeline bitbucket-pipelines.yml .

As you can see, the configuration is simple and consists of the following parts:

    1. Image: It's certainly not strange to know about Docker, by specifying an image to tell pipeline what image to pull for project compilation.
    2. Export: Specify the project name and test project name that we want to compile through export. (Note: You need to use a relative path.)
    3. Dotnet:.net Core's restore, compile, and test commands.

Because our project is based on. NET Core 2.0, and the layered schema is as follows:

We want to bitbucket-pipelines.yml make the following changes:

Modify completed, click on the commit file immediately into the pipeline run interface, running results are as follows:

At this point, we've completed building and testing the. NET core project. So how do you get it to do these two things automatically? Simply, go back to the pipeline interface and click on the "Schedules" menu to create a "Schedule".

How do you complete the deployment?

Because I'm using micosoft Azure for deployment, so according to the official document deploy to Microsoft Azure, we just need to bitbucket-pipelines.yml add a git push command later, as follows:
- git push https://$AZURE_LOGIN:[email protected]/Abpeshop.git master
where $AZURE_LOGIN and $AZURE_PASSWORD is the deployment credential for Azure, we need to define environment variables in our current project warehouse, as shown in:

There is no truth in the last Picture:

3. Finally

BitBucket offers a free build time of pipeline for 50mins/months, but it is enough for our simple early adopters! Of course, if not enough, its pay strategy is also very favorable, 2$/month, with 500mins/months of construction time.
Of course, Microsoft's VSTS is also a good choice.

Reference article:
. NET Core 2.0 Continuous integration, continuous publishing environment
Building NuGet (. NET Core) Using Atlassian bitbucket Pipelines
Building. NET Core Apps with BitBucket pipelines and Docker

Automated build, test, and deployment of. Net core projects using BitBucket pipeline

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.