带有基于 Web 的仪表板的构建和部署机器

发布于 2024-10-18 21:17:53 字数 255 浏览 3 评论 0原文

这就是我想要做的:我的代码位于 Bitbucket 上(它是一个 ASP.net Web 应用程序)。我想组装一台具有基于网络的仪表板的构建机器。我转到仪表板,然后说:好的,显示我的 Bitbucket 项目上的所有分支和内容。现在请为我从该分支获取最新代码并构建它。然后请为我将其部署到此位置或其他位置。我希望这个仪表板也能给我所有这些构建和部署的历史记录。我对这个概念很陌生,我一直在阅读有关 CC.net 和 MSBuild 以及其他内容的内容,但我找不到正确的答案。请让我走上正确的方向。

Here is what I am trying to do: I have my code sitting on Bitbucket (it is a ASP.net web application). I want to put together a build machine that has a web-based dashboard. I go to the dashboard and I say: Ok show me all the branches and stuff on my Bitbucket project. Now please get the latest code from this branch for me and build it. Then please deploy it to this location for me or maybe this other location. I want this dashboard give me a history of all this builds and deployments too. I am very new to this concept I have been reading about CC.net and MSBuild and other stuff but I can not find the right answer. Please put me in the right direction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红墙和绿瓦 2024-10-25 21:17:53

构建服务器的要点在于,每次您向存储库提交某些内容时,它都会自动运行构建。

为了让构建服务器准确地知道要做什么,您通常会将构建脚本(使用 MSBuild 或 NAnt)放入您的解决方案中,它会执行您想要的所有操作 - 构建您的解决方案,也许创建一个安装包等等。

构建服务器基本上知道存储库在哪里以及构建脚本在存储库中的位置。
您需要在构建服务器中配置一次,然后它将在您提交后始终运行(但如果需要,您也可以手动启动构建)。

如果您需要基于 Web 的仪表板的解决方案,请尝试 TeamCity
它是一个商业产品,但最多可免费供 20 个用户使用。
您可以在 Web 界面中执行所有操作 - 配置、运行构建以及浏览构建历史记录。


编辑:

Houda,关于您有关部署的问题:
我不认为 TeamCity 有这种意义上的“部署模式”。您可以做的是将部署内容包含在由 TeamCity 运行的构建脚本中。
因此,在构建本身完成后,将生成的程序集和文件复制到您的 Web 服务器上。

如果您这样做,则必须在构建脚本中确保只有在构建没有失败的情况下才会进行部署(并且如果您有单元测试,如果单元测试也没有失败)。

这对于实时应用程序非常重要,因为如果您处理得不够好,每次有人向您的存储库提交“坏”代码时,您的应用程序都会立即离线(并且它将保持离线状态,直到下一个“好”代码) “ 犯罪)!!


编辑 2:

请参阅下面 Lasse V. Karlsen 的评论:新的 TeamCity 版本 6 更加舒适。

The point of a build server is that it automatically runs a build each time you commit something to your repository.

In order for the build server to know exactly what to do, you normally put a build script (with MSBuild or NAnt) into your solution which does everything you want - building your solution, maybe create a setup package and so on.

The build server basically knows where the repository is and where in the repository your build script is.
You need to configure this once in the build server, and then it will always run after you commit (but you can also start a build manually, if you want).

If you want a solution with web-based dashboard, try TeamCity.
It's a commercial product, but it's free for up to 20 users.
You can do everything in the web interface - configuration, running the builds AND browsing the build history.


EDIT:

Houda, concerning your question about deployment:
I don't think that TeamCity has a "deployment mode" in that sense. What you could do is include the deployment stuff in your build script that is run by TeamCity.
So, after the build itself is finished, copy the generated assemblies and files on your web server(s).

If you do it this way, you HAVE to make sure in the build script that the deployment will only happen if the build didn't fail (and if you have unit tests, if the unit tests didn't fail as well).

This is very important for a live application, because if you don't take care of this well enough, your app will go immediately offline every time someone commits "bad" code to your repository (and it will stay offline until the next "good" commit)!!


EDIT 2:

See Lasse V. Karlsen's comment below: it's more comfortable with the new TeamCity version 6.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文