Renaming Artifacts

Answered

Hi,

I'm following on from a post in 2011, is it possible to rename an artifact after it's been built?

As we have multiple branches running, the nuget package which is built refers to the project name. When I expose this over the feed to octopus, it picks up the version with the highest number which I don't want. I want to show the artifacts from other build  configs even if they are the same name.

 

Thank you

6 comments

Hello Zahir,

There is no special functionality to rename artifacts in TeamCity. You can configure correct artifact names in the build script. We have the related request to rename downloaded artifacts https://youtrack.jetbrains.com/issue/TW-18399. Please vote for it if it's relevant.

0

Hi Alina,

 

How would I go about doing this in build scripts? I'm very new to this and haven't done that before.

0

Could you please describe you use case in more details? On what step do you need to rename artifacts? When artifacts are published or when artifacts are downloaded? 

0

When artifacts are published/created.

As we have multiple branches running, the nuget package which is built refers to the project name. When I expose this over the feed to octopus, it picks up the version with the highest number even though I may have 2 different build configs creating artifacts.

  • Build Config 1 - Builds Artifact 1.0.1 in Release Branch
  • Build Config 2 - Biulds Artifcat 1.0.1 in Dev Branch

I want to be able to rename the Dev Branch artifact to say '1.0.1 Dev' or something different which I can identify it by when using it via the TeamCity feed.

Please let me know if you need more information.

Thank you

0

Thank you for the provided details. The branch name is stored in %teamcity.branch.name% parameter that you can use in the build script when creating NuGet package.

0

Can you provide me with an example as I've never used TeamCity before.

I take it as I need to enter a command in the 'Command line parameter' section of the 'Nuget Pack' runner? Which command do I need to enter? According to the wiki (http://docs.nuget.org/ndocs/tools/nuget.exe-cli-reference#pack), there's nothing which will rename the package. I can change the version, but that can be done from the settings in the runner.

0

Please sign in to leave a comment.