TeamCity : How to create a delay between build steps

6.1k Views Asked by At

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

3

There are 3 best solutions below

0
On

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'
}
1
On

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
0
On

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.