Introduction to automatic deployment of windows +. NETCORE + git + IIS on Jenkins

Time:2021-8-22

What is automated deployment? I don’t want to introduce it. I like to go directly to the topic.

1、 Required environment:

1. The system is windows 10.

2. Asp.net core3.1 runtime must be installed because my code is asp.net core3.1. You can install the running environment according to the version of your code.

3. IIS ensure installation.

4. Windows git must be installed.

5. The JDK of Java must be installed, and Jenkins is installed in Java.

6. Create a new site called blog in IIS

II   Install Jenkins

Download address: https://www.jenkins.io/download/

After downloading, you can install step by step by default.

After selecting the plug-in to install, go to the following page and try to select the operation shown in the figure below. Otherwise, the installation of other plug-ins will fail, and it will take a long time. Therefore, select none and do not install any plug-ins.

In addition. You can create or create later in the later creation administrator operation. I chose to create later because it does not affect my later operation at all.

Here are the plug-ins we need to install:

1. Localization: Chinese (Simplified) bad English recommended installation

2、git

After installation, enter in the address bar: http://localhost:8080/restart   Restart. After the successful restart, you will see the Sinicized interface.

If the installation fails, you can access: https://plugins.jenkins.io/ , Download separately. See the following for details:

After downloading, it is a localization-zh-cn.hpi file.

Click Manage plugins on the home page and select the advance tab. Upload the downloaded file

Now start configuring GIT and enter global configuration.

If the path to git executable is configured as git.exe, you can fill in the installation path.

Mine is: e: \ git install \ git \ bin \ git.exe.

Finally, you can start creating a new item. Select new item

Now enter the configuration page of the project and fill in the GIT address and login user name and password.

 

Select build

The above commands can also be combined into one.

e:
 
cd E:\jenkins-2.153\install\workspace\TestItem
 
dotnet build
 
C:\Windows\System32\inetsrv\appcmd.exe stop apppool /apppool.name:blog
 
dotnet publish -o F:\code\publish\Blog.HuoChong
 
C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:blog

By the way, if you don’t know where the default workspace under Jenkins is, you can also not specify the specific project drive letter path. Just write it like this.

dotnet build
 
C:\Windows\System32\inetsrv\appcmd.exe stop apppool /apppool.name:blog
 
dotnet publish -o F:\code\publish\Blog.HuoChong
 
C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:blog

Then, apply, select save, and finally select build.

According to the results in the figure above, I can open the IIS site after the construction is successful.

The next article shares the automatic deployment of. Net framework + SVN on Jenkins.

Recommended Today

The selector returned by ngrx store createselector performs one-step debugging of fetching logic

Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]