I have a build step in my build configuration thats runner type "Command Line", running a custom script.
The script is executing Robocopy:
robocopy "%teamcity.build.workingDir%\Code" "\\target\d$\Web\Target Sites" /E /NP /LOG:robocopy.log
if ERRORLEVEL GEQ 4 (
"D:\blat.exe" "robocopy.log" -to [email protected] -f [email protected] -subject "Error during robocopy on TEAMCITY" -server mail.me.com
)
exit /B 0
The Robocopy command is working fine but I keep getting an email and in the build log I keep seeing:
GEQ was unexpected at this time.
The ERRORLEVEL check isn't working for some reason?
I tried IF %ERRORLEVEL% GEQ
but this breaks my build has TeamCity expects me to pass a build parameter.
Does this only work as an "Executable with parameters"?
In Build Steps, click Auto-detect build steps, and then select the proposed steps you want to add to the current build configuration. You can change their settings afterwards. When scanning the repository, TeamCity progressively searches for project files on the two highest levels of the source tree.
To open the tool's settings page, navigate to the My Settings&Tools page| TeamCity Tools side panel | Command Line Remote Run and click configure. Create a mapping configuration file: select a build configuration to run your personal build on from the dropdown with and click Add.
Neil, you might try escaping the percent sign.
Try IF %%ERRORLEVEL%% GEQ ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With