Renaming a file with Artifact Dependencies

Hi,

I'm trying to copy the artifacts from a build to another directory and this is working.  However, I would like one of the files to be renamed and wondered if this is possible?  My current attempt was to create an artifact path like this:

www/**/*.*=>c:\website
-:www/Web.config
-:www/Web.config.*
+:www/Web.config.test => c:\website\Web.config



The idea is to copy the entire "www" artifact folder to "c:\website", EXCLUDING the web.config and any files named Web.config.*, INCLUDE Web.config.test but output to Web.config.  There will then be a similar build for Web.config.live for the live version of the site.

If this isn't possible, can I specify that a build step runs after the artifacts are copied?  That way I can just script it, though it seems that the build steps run before this point?
The project doesn't currently have any build steps - it just depends on another project that builds successfully.

Hope that makes sense!

Thanks in advance,
Simon.
[Using TeamCity 7.0.3 (build 21424)]
4 comments
Comment actions Permalink

Simon,

Artifact renaming is not supported in artifact dependencies. Any target path you specify is a directory. So the only option is to you a command line build step or rename file by your build script.

Build steps start only after all artifact dependencies were resolved, downloaded (and unpacked, if applicable). So you can be sure, that file is already there by the time you scipts are run.

0
Comment actions Permalink

Thank you Nikita.

"Build steps start only after all artifact dependencies were resolved, downloaded (and unpacked, if applicable). So you can be sure, that file is already there by the time you scipts are run"

Does that mean that the build step should run against the destination path (in my example: c:\website)?

Appreciate your help.
Simon.

0
Comment actions Permalink

Yes. File will be already placed in C:\website

0
Comment actions Permalink

That's great, thanks Nikita.

It just confused me slightly because the artifact dependencies are configured in 'step 6' of the build configuration, but the build steps are configured in step 3 - hence thinking the build steps go first!

Cheers for the quick reply,
Simon.

0

Please sign in to leave a comment.