gpt4 book ai didi

continuous-integration - TeamCity 在构建时删除文件

转载 作者:行者123 更新时间:2023-12-05 00:08:56 24 4
gpt4 key购买 nike

我是 TeamCity 和持续集成的新手。我已关注 this设置一切的非常好的指南,一开始似乎一切正常。

TC 可以从 SVN check out 文件,并且可以毫无问题地构建它们。但是我发现“结帐目录”设置是错误的,它指向上面应该放置的文件夹,因此将来自 SVN 的所有新文件添加到错误的位置,但仍在旧文件上构建。纠正这个问题后,问题开始了。

现在每次 TC 进行构建时,它都会清除“Checkout 目录”中的所有文件,问题在于并非所有需要的文件都由 SVN 管理,它们会被永久删除。由于并非所有必需的文件都在那里,因此构建失败。

我应该怎么做才能让 TC 保留我的文件?

TC 的设置是否有帮助:

General settings edit »

Name: Mavia Build

Description: none

Build number format: {0}, next build number: #8

Artifact paths: none specifed

Fail build if:

process exit code is not zero: ON

at least one test failed: ON

an error message is logged by build runner: OFF

it runs longer than: no limit

out of memory or crash is detected: ON

Build options:

hanging builds detection: ON

status widget: OFF

maximum number of simultaneously running builds: unlimited

Version control settings edit »

VCS checkout mode: Automatically on server

Checkout directory: C:\Inetpub\wwwroot\mavia_sip

Clean all files before build: OFF

VCS labeling: disabled

Attached VCS roots:

Name Checkout rules Set label

mavia_sip svn not specified NO

Runner: sln2008 edit »

Type of runner: sln2008 (Runner for Microsoft Visual Studio 2008 solution files)

Solution file path: mavia_sip\WebSite\mavia_sip.sln

Working directory: same as checkout directory

Targets: Rebuild

Configuration: Debug

Solution Platform: default

NUnit Run platform: auto(MSIL)

NUnit runner: NUnit 2.2.10

Run tests from: none specified

Do not run tests from: none specified

NUnit categories include: none specified

NUnit categories exclude: none specified

Reduce test failure feedback time: OFF

MSTest: disabled

XML report processing: disabled

Build triggering edit »

Build configuration is paused (triggering disabled).

Trigger build by vcs check-in: ON

Quiet period: default, 60 seconds

Start new build if last build is failed: OFF

Triggering by time: not configured

This configuration depends on: not configured

Dependencies edit »

Snapshot Dependencies:

There are no snapshot dependencies.

Artifact dependencies:

There are no artifact dependencies.

Properties and environment variables edit »

System properties: none defined

Environment variables: none defined

Agent requirements edit »

Requirements for system properties: none defined

Requirements for environment variables: none defined

最佳答案

好的,我就是这样做的:

首先,我让 TC checkout 并在站点上的单独文件夹中构建项目。需要的外部 dll 从“bin”文件夹移动到一个单独的文件夹并添加到 subversion(也在 Visual Studio 中更新引用)。

现在 TC 可以毫不费力地构建项目。

其次,我在 Visual Studio 中创建了一个 Post Build Script,如下所示:

xcopy "C:\TeamCityBuild\mavia_sip\WebSite\*" "C:\Inetpub\wwwroot\mavia_sip\WebSite\" /C /R /Y /E
if errorlevel 1 exit 0

当有人在没有正确文件夹结构的环境中构建项目时,才需要错误处理以避免脚本错误。

到目前为止,一切都很好!

关于continuous-integration - TeamCity 在构建时删除文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/942267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com