5

I'm having an issue with TeamCity, building some Android APK's.

I have both a QA and Release APK's, each in it's own build step.

The problem is the Release build step never completes, as it seems to access a file that is still being used by the QA build step.

I have tried adding a Powershell build step between the two, using

Start-Sleep -Seconds 10

However, this doesn't seem top cause TeamCity to wait.

Does anybody know how to create a pause between build steps?

Thanks

Greg Quinn
  • 1,927
  • 1
  • 23
  • 26

3 Answers3

10

I ran into the same problem. However, I needed a controlled/longer delay. I found Teamcity could be delayed using the old school ping delay method. Anyhow, I know you solved your problem, but figured others may benefit from this; this URL is #1 on my google search results.

REM Delay for 30 sec  
ping -n 30 127.0.0.1 > nul
dimo414
  • 47,227
  • 18
  • 148
  • 244
Ivan Plascencia
  • 141
  • 2
  • 8
  • A problem with this is that you are causing a build agent to be consumed, doing nothing, for 30 seconds. Instead of delaying, should this be done with a dependency? I know delays are needed at times, but this doesn't feel like one of those times. – John Rocha Apr 19 '17 at 16:55
0

I resolved this using a while loop instead.

The problem was a shared file being used.

while ( test-path 'D:\Builds\File.txt') {
del 'D:\Builds\File.txt'
}
Greg Quinn
  • 1,927
  • 1
  • 23
  • 26
0

FWIW I'm on TeamCity 9.x and the original script that sleeps for 10 seconds as declared in the question seems to work for me in a trivial project with one PowerShell step.

ojintoad
  • 433
  • 3
  • 6