Nuget feed with S3 Artifact Storage not uploaded to s3

We have a project configured to use S3 Artifact Storage, which also configures an auto-indexed nuget feed. Artifacts published by builds within this project using the nuget API (eg: nuget push https://my-teamcity-server/…) don't get uploaded to S3 - they are stored locally on the server instead.

How can we force TeamCity to upload nuget packages to S3?

0
5 comments

To clarify, the problem is that artifacts published by specifying `Artifact Paths` ARE uploaded to S3. Artifacts published by pushing to the nuget feed are NOT uploaded to S3. I've tried creating a NuGet feed within a subproject with the same result - all artifacts published to the nuget feed go to internal storage rather than AWS S3.

I am running version 2024.12.3.

0
Hi Andrew,

In TeamCity, when using the internal NuGet feed, packages published via nuget push are stored in TeamCity’s local data directory, rather than in external storage like Amazon S3. As far as I understand, this is expected behavior currently.

For example:

>You can add TeamCity NuGet feeds as package sources on your developer machine. For example, to use packages during development, use the `nuget sources` (https://docs.microsoft.com/en-us/nuget/tools/cli-ref-sources) command or NuGet package management in your IDE.

In this setup, if artifacts are published to AWS, there is currently no way to access AWS S3 directly from the IDE, as in the TeamCity, we use the connection function to connect to AWS.

Currently, there appears to be no built-in way to store NuGet packages in S3 directly through TeamCity’s NuGet feed. If storing packages in S3 is required, one potential workaround would be to periodically migrate the packages from TeamCity’s local storage to an S3 bucket via custom scripts. However, this is not natively supported by TeamCity.

Best Regards,
Tom
0

Tom Sun I cannot find any documentation of this limitation - the implication is that nuget packages pushed by a build configuration will be treated as build artifacts. For example - 
> To index all .nupkg files published as build artifacts in the project, enable Automatic Packages Indexing in the NuGet Feed section of the Project Settings.

> Note that pushing a package is only possible from within a build. Any attempts to push external packages into the TeamCity feed will fail.
(https://www.jetbrains.com/help/teamcity/using-teamcity-as-nuget-feed.html#Using+NuGet+push+command

Indeed, the pushed nuget packages appear as standard build artifacts, and checking usages of the S3 Storage through the UI indicates that the build used S3. Enabling automatic indexing and publishing the nuget packages through a service message or “Artifact Paths” works as expected, leading me to believe that this is unintended behavior.

Glancing at the [teamcity-nuget-support plugin source](https://github.com/JetBrains/teamcity-nuget-support/blob/master/nuget-feed/src/jetbrains/buildServer/nuget/feed/server/controllers/upload/PackageUploadHandler.java#L270) reinforces that belief - it calls `RunningBuildEx.publishArtifact()` which according to the docs “Adds artifact to the build by the specified path”.

0
Hi Andrew,

Thank you very much for your patience. I am currently in the process of confirming this matter with our Dev Team. As soon as I have any updates, I will inform you promptly.

Best Regards,
Tom
0
Hi Andrew,

Thanks for your patience and cooperation.

I received the answer from our Dev team:

'Only build artifacts with specified artifact paths are published to S3 buckets.'

Therefore, it is expected that NuGet-related files will not be uploaded to the S3 bucket in your case.

Best Regards,
Tom
0

Please sign in to leave a comment.