I have built a 2 steps build chain in TeamCity. 1. step builds solution and creates artifacts on disk. Second step deploys to our remote IIS.
Everything works fine except this error occuring on every second build: Error: Object of type 'contentPath' and path 'C:\ProgramData\JetBrains\TeamCity\system\artifacts\ph\Build\198' cannot be created.
I must manuly set the Build counter parameter value to make this work, since each build is incrementing value for 2 and not for 1 and then, the deploy task cannot find artifacts in folder system.
Deploy command looks like this and the problem is, I guess, in reading source path. Looks like that deploy task has wrong information about source path. What parameter could I use in deploy command to avoid this?
Deploy Command:
-source:contentPath="C:\ProgramData\JetBrains\TeamCity\system\artifacts\ph\Build\%build.counter%"
-dest:contentPath="C:\inetpub\wwwroot\ph", computerName="%system.MsDeployServiceUrl%", userName="%system.UserName%", password="%system.Password%", authtype="basic", includeAcls="False"
-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension
-disableLink:CertificateExtension -allowUntrusted