TeamCity : How to create a delay between build steps
Asked Answered
J

3

6

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

Junoesque answered 4/1, 2015 at 22:26 Comment(0)
E
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
Exhale answered 24/4, 2015 at 17:8 Comment(1)
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.Sacramental
J
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'
}
Junoesque answered 4/1, 2015 at 22:35 Comment(0)
E
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.

Escamilla answered 23/5, 2016 at 21:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.