teamcity

Target not running when using BeforeTargets=“Build” on Build Server

时间秒杀一切 提交于 2019-11-29 04:14:17
I have a custom .targets file which I import into my C# MVC web application's project file. I've added custom targets to this like so: <Target Name="CopyFiles" BeforeTargets="Build"></Target> This works fine when building under Visual Studio, but when I use TeamCity to build it, the target never gets run, and I can't work out why. If I change my target to use BeforeTargets="Compile" then it runs. Alternatively, if I add an additional target with the name Build to the .targets file <Target Name="Build" /> then it will run, but doing so overrides the existing Build target and thus my application

Can't get basic Powershell script running inside Team City

走远了吗. 提交于 2019-11-29 03:43:22
Here's my configuration: On the build log, I only see the output of the first two lines, and then "Process exited with code 0" as the last output of this build step. I tried opening a terminal in the build server in the SYSTEM account (using PsTools ), since Team City is configured to run under said account. Then, I created a Test.ps1 file with the same content and ran a command just like Team City's: [Step 1/4] Starting: C:\Windows\system32\cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command - <C:\TeamCity\buildAgent\temp\buildTmp

Teamcity running build steps even when tests fail

无人久伴 提交于 2019-11-29 02:55:24
I am having problems with Teamcity , where it is proceeding to run build steps even if the previous ones were unsuccessful. The final step of my Build configuration deploys my site, which I do not want it to do if any of my tests fail. Each build step is set to only execute if all previous steps were successful. In the Build Failure Conditions tab, I have checked the following options under Fail build if: -build process exit code is not zero -at least one test failed -an out-of-memory or crash is detected (Java only) This doesn't work - even when tests fail TeamCity deploys my site, why? I

Conditionally execute a TeamCity build step

旧巷老猫 提交于 2019-11-29 02:47:58
I am working on defining a general-purpose build template for all our projects -- which I have placed at the "root project" level (thanks to this new feature of TeamCity 8). Some of our projects create an installer, which needs to be generated by a separate "build step" that runs a powershell script. However, some of our projects do not create this installer, and hence do not need this additional build step. Is there a way to conditionally execute a build step, based on a build parameter? I thought that perhaps the "disable build step" feature could be leveraged here, but I don't see a way to

TeamCity Build Failure

柔情痞子 提交于 2019-11-29 00:22:01
I have tried many things today to get my build to work in Teamcity but to no avail. Here is my setup. I have 2 build configurations in TeamCity Build Solution Build Deployment Package Debug Build Solution is triggered by an SVN checkin and builds the solution file. This configuration works fine. Build Deployment Package Debug has Build Solution as its dependency and has two (MSBuild) build steps. The solution contains two websites: a front end one and an admin one. One build step builds the front end site and the other the admin site. The end result is that it puts the combined results into a

How to get the unit test method name at runtime from within the unit test?

情到浓时终转凉″ 提交于 2019-11-29 00:10:12
问题 How to get the unit test name from the within unit test? I have the below method inside a BaseTestFixture Class: public string GetCallerMethodName() { var stackTrace = new StackTrace(); StackFrame stackFrame = stackTrace.GetFrame(1); MethodBase methodBase = stackFrame.GetMethod(); return methodBase.Name; } My Test Fixture class inherits from the base one: [TestFixture] public class WhenRegisteringUser : BaseTestFixture { } and I have the below system test: [Test] public void

Using git commands in a TeamCity Build Step

寵の児 提交于 2019-11-28 22:23:25
One of my TeamCity v7.0 build projects relies on using a diff between the current development branch and the master branch to determine what needs to be run. I've written a small script that uses something like: git diff origin/master..origin/QA --name-only --diff-filter=AM | DoSomethingWithThoseFiles Unfortunately, the build log indicates that git diff is not working. When I go into the buildAgent/work directory for this project, I see that there is no .git folder, so it cannot perform the git operations required. I've put teamcity.git.use.local.mirrors=true in the buildAgent.properties file

How to setup a TeamCity build for a ASP.NET 5 project

三世轮回 提交于 2019-11-28 20:35:20
问题 I'm trying to setup a CI server for a website that I'm developing, but I can't find any info regarding how to do it with the new ASP.NET 5. 回答1: We (the ASP.NET team) use TeamCity as the build server. Each repo has a build.cmd file, similar to this one. TeamCity simply invokes that file. For Mac/Linux builds, there is a build.sh file. 回答2: I got you brother. This took me a few days to figure out. This configuration is on TeamCity v10 for a ASP.NET Core 1.0 RC2/preview2 project. As a bonus, I

TeamCity - using setParameter to pass information between build steps

时光总嘲笑我的痴心妄想 提交于 2019-11-28 20:09:41
问题 I must be doing something differently than what was asked and answered here because the solution does not appear to be working for me: TeamCity, passing an id generated in one build step to a later build step I want use a string generated by one build step in a final build step. So far I have set up an environmental variable called "TEST" that is empty. Both build steps use the Command Line Runner. Build Step #1: \##teamcity[setParameter name='env.TEST' value='test'] Build Step #2: echo $TEST

'dotnet restore' vs. 'nuget restore' with TeamCity

寵の児 提交于 2019-11-28 19:08:30
I have an ASP.NET Core project that builds properly with Visual Studio, but it doesn't build under MSBuild. It doesn't find all the common libraries (system, etc.). I'm using TeamCity and part of the build process is a nuget restore . I tried to do the same steps as TeamCity, but manually with MSBuild, and it failed, not finding the libraries. I added a dotnet restore step and then it worked. So, what is the difference between a nuget restore and a dotnet restore ? Martin Ullrich Both nuget restore and dotnet restore are roughly the same: They perform a NuGet restore operation. The only