The ANT build script I have does the following:
- Perform the builds on Windows server & Zip the binaries
- Map a network drive with different credentials to a local drive (ex P:) using
net use
- I am using
<mkdir>
to create a directory on the mounted drive (P:) - Copy the binaries to that drive
Below is my code for mkdir
<echo>Creating ${buildRequesterUserId} folder at mirroring site starts</echo>
<mkdir dir="P:\build_output\${buildRequesterUserId}"/>
<echo>Creating ${buildRequesterUserId} folder at mirroring site ends</echo>
Some time the creation of folder works and some time it fails with below error
creation was not successful for an unknown reason
and makes the build fail
This error happens randomly. The Mkdir works some time. I am not sure why it fails and not sure if its because of network lag
also the directory i am trying to create may or may not exist already. I read that the mkdir does not do anything if directory exists already
I checked and there is no failonerror
for mkdir. I don't want the build to fail because of this.
I have handled the error in copy
part but not sure how to handle this mkdir
How can I achieve this? Any help would be appreciated
Regards
Karthik