ASP. NET Core + Docker +jenkins for continuous integration

Source: Internet
Author: User
Tags set time

1. Create a new ASP. NET Core MVC application:

2. Upload it to git:

3. Create a Jenkins task

(1) Select "New Task", enter the task name, select "Free Style project", then click OK:

(2) Select "Source Code Control" to fill in our Git address

Enter H/2 * * * * settings two minutes to pull once

(3) Build environment

Check the Delete workspace before build start delete workspace before setting up the build

The tick Abort the build if it‘s stuck is to set the time-out for the build, and if the build takes longer than the set time, then the build is considered a failure. The author here time-out setting is 10 minutes

(4) Add an Execute Shell script and fill in the following script contents

#!/bin/bash# 获取短版本号GITHASH=`git rev-parse --short HEAD`echo ---------------Remove-Orphans------------------docker-compose -f ./docker-compose.yml -f ./docker-compose.override.yml  -p dockercompose4255153253317384266 down --rmi local --remove-orphansecho ------------------Config-----------------------docker-compose -f ./docker-compose.ci.build.yml -p dockercompose4255153253317384266 configecho ------------------Build------------------------docker-compose -f ./docker-compose.ci.build.yml -p dockercompose4255153253317384266 up --buildecho ---------------Publishing...------------------docker-compose -f "./docker-compose.yml" -f "./docker-compose.override.yml"  -p dockercompose4255153253317384266 up -d --build

The app is saved and returned to the project interface. Click Build now to deploy your work

We can view the console output:

Reference article:

Http://www.cnblogs.com/LongJiangXie/p/7517909.html
Https://www.cnblogs.com/myzony/p/8434121.html

ASP. NET Core + Docker +jenkins for continuous integration

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.