Visual Studio vessel project engineering experience

introduction  

  Watch blogger users will see I'm using ASP.NET Core container deployment enterprise-level project process and think about the development process, we have some engineering experience to share to the students.

 

Project engineering

  Because this project involves unit testing Project, container deployment, localization sqlite database, nlog log, it is necessary to give my Visual Studio 2019 solution catalog:

.
├── container
│   ├── app
│       ├── publish
│       ├── Dockerfile
│   ├── nginx
│       ├── Dockerfile
│       ├── nginx.conf
│   └── docker-compose.yml
├── .dockerignore
├── Eqid-Manager.sln
├── .git
├── .gitattributes
├── .gitignore
├── NuGet.Config
├── src
│   ├── EqidManager
│       ├── Property
│          ├── PublishProfiles
│              ── FolderPublish.pubxml 
└── test
    ├── EqidManager.Test
We need to understand that:

① the establishment of container folder

  The specialized storage container deployment-related documents , will develop content and deploy content is a separate DevOps practices, while also achieving CI / CD do little to pave the way for our future.

  Tip: When using Visual Studio, you can build solution files with the same name as a folder above elements, it is easy to deploy developers to write scripts.

 

② write git ignore file

  Daniel had a lot of online sharing of operating skills git, add, commit, push, checkout, merge believe that many developers like overripe heart.

But as the Enterprise project, how many will involve some unwanted code repository management files (key files, temporary files, local database files, log files), which involves the use of git ignore the richer official documentation here: HTTPS : //git-scm.com/docs/gitignore

This operation is often a one-time configuration is done by architects, many students did not develop practical operation before, today we have to play with it.

// write in the same directory .gitignore .sln solution file: Ignore the User File VS, NuGet Package Penalty for, the TEMP Files 
 * .suo
 * .user 
Packages Standard Package 
.VS 
.nuget 
Container / App / publish / * 
//   write in EqidManager project folder .gitignore file: Ignore LocalDB, logs, the TEMP Files 
* .suo
 * .user 
bin 
obj 
Internal - nlog.txt 
EqidManager.db 
healthchecksdb

 

③ write WebDeploy Publish Profile

  Mirroring the preparation of documents and the corresponding Dockerfile container folder contains app and nginx, here we focus on app / publish folder, which will store the final executable file of this application.

Use WebDeploy when deployed, to generate the file path deployment, to facilitate unified management , FolderPublish.pubxml produced as follows:

<? xml Version = " 1.0 " encoding = " UTF-8 " ?>
 <-! 
This file consists of Web publishing project / packaging process use. This can MSBuild file by editing 
to customize the behavior of this process. In order to understand more content related to this, please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-> 
<the ToolsVersion the Project = " 4.0 " xmlns = " http://schemas.microsoft.com/developer/msbuild/2003 " > 
  <the PropertyGroup> 
    <WebPublishMethod> the FileSystem </ WebPublishMethod> 
    <PublishProvider> the FileSystem </ PublishProvider> 
    < LastUsedBuildConfiguration> Release </ LastUsedBuildConfiguration> 
    <LaunchSiteAfterPublish> True </ LaunchSiteAfterPublish> 
    <ExcludeApp_Data> False </ ExcludeApp_Data> 
    <ProjectGuid> 1213badd-176e-4c24-af84-bfdb0517b692 </ ProjectGuid> 
    <publishUrl> ../../container/app/publish </ publishUrl> 
    <DeleteExistingFiles> False </ DeleteExistingFiles> 
  </ PropertyGroup> 
</ project> 

<-! 
  attention-line yellow background, publish directory using a relative path (relative to the project file *** csproj path.) 
->
 

  According to this configuration WebDeploy deployment files generated in the project directory container / app / publish, when ready to deploy a direct copy folder container, the container is formed and generated image.
  This article is a rough share practical Devloper container using the Visual Studio development system project,
CI / CD please stay tuned.

Author: JulianHuang

Thank you for your read, any questions please correct me bold; find it useful, please below or add attention.

Welcome to reprint this article, but please keep this paragraph statement, and noted the article page article in the apparent position of the author and link the original.

Guess you like

Origin www.cnblogs.com/JulianHuang/p/10983973.html