简体   繁体   English

使用Visual Studio Team Services构建ASP.NET网站并将其发布到VPS Windows Server 2012 R2

[英]Build and release ASP.NET website to VPS Windows Server 2012 R2 using Visual Studio Team Services

I am currently using Visual Studio Team Services (was VS Online) to version control my projects. 我目前正在使用Visual Studio Team Services (was VS Online)对项目进行版本控制。 When I want to deploy my projects to my VPS I use the Visual Studio Publish that stores the files on my hard drive and then I use an FTP client to send the files to my VPS. 当我要将项目部署到VPS时,我使用Visual Studio Publish将文件存储在硬盘上,然后使用FTP客户端将文件发送到VPS。

But now I am viewing the build and release functions in Visual Studio Team Services. 但是现在我正在查看Visual Studio Team Services中的构建和发布功能。 But I don't completely understand it all. 但是我不完全理解这一切。

Questions: 问题:

  • What is the purpose of the build? 构建的目的是什么?

I have created a new standard build definition using the Visual Studio template and used the Host agent pool. 我已经使用Visual Studio模板创建了一个新的标准构建定义,并使用了Host代理池。

When I run the build I can see that it creates a new version using the last commit as reference. 运行构建时,我可以看到它使用上一次提交作为参考来创建新版本。 But what has it done in the backend on the host agent? 但是在主机代理的后端它做了什么?

And where are the files stored of this new created build? 这个新创建的版本的文件存储在哪里? In the log I see Copy Files to: $(build.artifactstagingdirectory) but where is this? 在日志中,我看到Copy Files to: $(build.artifactstagingdirectory)但这在哪里?

  • What is the purpose of the release? 发布的目的是什么?

I have created a new release plan using the empty template because I don't have Azure, I use another company where I have a VPS running. 我使用空模板创建了一个新的发布计划,因为我没有Azure,而是使用另一家运行VPS的公司。

I then added 3 environments called Development , Staging and Production . 然后,我添加了3个称为DevelopmentStagingProduction

All of them using the Host agent, but I think here I need to adjust this because if I understand it I now can assign my VPS to my Production environment or not? 他们所有人都使用Host Agent,但是我认为我需要对此进行调整,因为如果我理解了,我现在可以将我的VPS分配给我的Production环境了吗?

Does someone has done this using Visual Studio Team Services and a VPS that runs on Windows Server 2012? 有人使用Visual Studio Team Services和在Windows Server 2012上运行的VPS做到了吗?

Are there videos or docs available about this because its quite confusing what the correct steps are in deploying versions of web projects. 是否有关于此的视频或文档,因为在部署Web项目的版本时正确步骤是相当混乱的。

In general, "Build" focus on integrating and building your code changes and run some basic unit tests. 通常,“构建”专注于集成和构建代码更改并运行一些基本的单元测试。 And "Release" is used to deploy the output of "Build" to your environments so that you can run some future tests/verification and final deploy the output to a production environment for your customers to use. 而且,“发布”用于将“构建”的输出部署到您的环境中,以便您可以运行将来的一些测试/验证,并将输出最终部署到生产环境中以供客户使用。 See this link for reference: What is the difference between build and release engineering, DevOps and site reliability engineering? 请参阅此链接以供参考: 构建和发布工程,DevOps和站点可靠性工程之间有什么区别?

When you start a build without any source version specified, it will get the latest version of the code and then build the code. 当您开始构建时未指定任何源版本时,它将获取最新版本的代码,然后生成代码。 All the files are placed in the working folder of the build agent during the build process. 在构建过程中,所有文件都放置在构建代理的工作文件夹中。 $(build.artifactstagingdirectory) is a predefined variable that point to a path in the build agent work folder. $(build.artifactstagingdirectory)是一个预定义变量,它指向构建代理程序工作文件夹中的路径。 We usually copy the build output to this path so that we can access to output easily in the following tasks. 我们通常将构建输出复制到此路径,以便在以下任务中可以轻松访问输出。 For example, use "Publish Artifact" task to publish the output files in $(build.artifactstagingdirectory) folder to the server or a file share, and then the team members can get this build from server or file share. 例如,使用“发布工件”任务将$(build.artifactstagingdirectory)文件夹中的输出文件发布到服务器或文件共享,然后团队成员可以从服务器或文件共享获取此构建。

In the release, you can link a release to the build definition. 在发行版中,您可以将发行版链接到构建定义。 When the release starts, it will get the latest artifacts of the build and deploy to your environment. 发布开始时,它将获得构建的最新工件并部署到您的环境中。

The agent is a machine used to execute the tasks in build/release definition. 代理是用于执行构建/发布定义中的任务的机器。 Hosted agent is managed by Azure and you can also deploy your own build agent . 托管代理由Azure管理,您也可以部署自己的生成代理 So you don't need to change the agent settings for "Production" environment if your VPS can be accessed by the Hosted agent. 因此,如果托管代理可以访问您的VPS,则无需更改“生产”环境的代理设置。 Since you are using FTP to upload files to your VPS previously, you can still use this method to publish the files by adding a FTP Uploader task in release definition. 由于以前使用FTP将文件上传到VPS,因此仍可以使用此方法通过在发行版定义中添加FTP Uploader任务来发布文件。

For more information, refer to Build and Release Management for details. 有关更多信息,请参考构建发布管理以获取详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Visual Studio 2012 ASP.NET(4.5框架)项目部署到Server 2012 R2 Standard - Deploy Visual Studio 2012 ASP.NET (4.5 Framework) project to Server 2012 R2 Standard 在Windows Server 2012 R2上运行Asp.net 5 vNext项目(MVC6)发布生成 - Run Asp.net 5 vNext project (MVC6) publish build on Windows Server 2012 R2 使用Visual Studio 2012部署ASP.NET网站(.NET 2) - Deploy ASP.NET Website (.NET 2) using Visual Studio 2012 Windows Server 2012 Standard R2上asp.net中的Oracle ODP.net异常 - Oracle ODP.net exception in asp.net on windows server 2012 standard R2 在Windows 2012 R2上安装ASP.net 4.5 - Installing ASP.net 4.5 on Windows 2012 R2 在IIS 8.5和Windows Server 2012 R2上运行的ASP.NET应用程序的默认GC模式 - Default GC mode for ASP.NET applications running on IIS 8.5 and Windows Server 2012 R2 回发asp.net 4上的IIS 8.5 Windows Server 2012 R2错误“ HostingEnvironment导致关闭” - IIS 8.5 Windows Server 2012 R2 error “HostingEnvironment caused shutdown” on postback asp.net 4 ASP.NET 4.8 功能在 IIS 8.5 (Windows Server 2012 R2) 中不可用 - ASP.NET 4.8 Feature unavailable in IIS 8.5 (Windows Server 2012 R2) Windows Server 2008 R2终端服务服务器上的ASP.Net本地调试 - ASP.Net local debug on a Windows Server 2008 R2 Terminal Services Server asp.net中Windows Server 2008 R2上的PDF缩略图 - PDF Thumbnails on windows server 2008 R2 in asp.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM