[英]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: 问题:
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)
但这在哪里?
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个称为
Development
, Staging
和Production
。
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.