Download
- TeamCity, current version: 2017.1
- Teamcity plug-in:. NET Core Support
- . NET Core SDK, current version: 1.0.1
Installation
Install teamcity. Places to be aware of:
- Installation path
- Port, this is 9080.
- Install the account for the server and agent Windows services (it is recommended to use the system account instead of the user account)
After the installation is complete, the Teamcity page is automatically opened and the configuration is initialized. Data Catalog, database and management users.
Install the Teamcity plugin:. NET Core Support.
There are two ways to install plug-ins, the details can be referred to "Installing Additional Plugins". Here is a brief description of how the file is copied.
- Find the plugin folder, here is: C:\ProgramData\JetBrains\TeamCity\plugins
- Copy the downloaded plug-in file (Dotnet-core-plugin.zip) in, and be careful not to change the file name.
- Restart the Teamcity service, refresh the Teamcity page, and teamcity will install the plugin automatically.
- After the plug-in installation is complete, you can check the Administration->plugins list page to see if the plugin is installed correctly.
Install the. NET Core SDK.
Configuration
The next step is to complete the process of automatically compiling and publishing the Web application by configuring Teamcity.
- Create Project. Administration->projects->create Project
- Configure VCs as per the actual situation.
- Create the project.
- Because the. NET core teamcity plug-in is installed, several key build processes are automatically checked out. This only requires the first two, which is restore and publish.
- Modify the publication. Only configuration and output directory are modified here
- Save. The most basic automated release process has been completed here. Can already be run.
Perfect
Next, I will be based on some of the actual situation, the configuration of the teamcity to complete a step.
- When the ASP. NET core Web application is hosted in IIS, running the above process may cause problems with the inability to copy files. There are two ways to solve this problem:
- Stop the IIS service before publishing and start the IIS service when publishing is complete. Add two command-line step.
- net start w3svc
- net stop w3svc
- Stop a site before publishing, launch a site after publishing
- "C:\Windows\System32\inetsrv\appcmd" Start Sites "name"
- "C:\Windows\System32\inetsrv\appcmd" Stop Sites "name"
-
Automated compilation and publishing of ASP. NET Core Web application via teamcity