How do we stop TeamCity publishing to the wrong feed?
isme
Posts: 119
Hey RG,
We use the Red Gate (SQL Server) build step for TeamCity to publish a package to RGDM.
Our build log shows that the TeamCity tries and fails to publish to a feed hosted on MyGet.
Some feed details are faked for security, but the output is otherwise unmodified.
We only want to publish to TeamCity's feed, but we can't specify the target feed in the build step.
The settings for RGDM only let you specify where RGDM is, what to call the package, and what your API Key is.
Our settings look like this:
RGDM's feed API ( http://redgatedeploy:81/api/feeds ) lists three feeds: MyGet, RDGM, and TeamCity.
How do we configure our build to publish to just the TeamCity feed?
We use the Red Gate (SQL Server) build step for TeamCity to publish a package to RGDM.
Our build log shows that the TeamCity tries and fails to publish to a feed hosted on MyGet.
[18:55:02]Publishing database package ApiServices-backend-database version 0.87 to https://www.myget.org/F/f4k3f33dl1nk/ (2s) [18:55:05]##teamcity[buildStatus status='FAILURE' text='Publishing database package ApiServices-backend-database version 0.87 to https://www.myget.org/F/f4kef33dl1nk/ failed with error InvalidOperationException'] [18:55:05]sqlCI error occurred: System.InvalidOperationException: Failed to process request. 'OK'.
Some feed details are faked for security, but the output is otherwise unmodified.
We only want to publish to TeamCity's feed, but we can't specify the target feed in the build step.
The settings for RGDM only let you specify where RGDM is, what to call the package, and what your API Key is.
Our settings look like this:
Package ID: ApiServices-backend-database
Server URL: http://redgatedeploy:81
DM API Key: ***************************
RGDM's feed API ( http://redgatedeploy:81/api/feeds ) lists three feeds: MyGet, RDGM, and TeamCity.
[ { "Id": "feeds-129", "Name": "MyGet feed", "FeedUri": "https://www.myget.org/F/f4kef33dl1nk/", "Links": { "Self": "/api/feeds/feeds-129", "Packages": "/api/feeds/feeds-129/packages" }, "Username": "********", "Password": "********" }, { "Id": "feeds-default", "Name": "Deployment Manager package feed", "FeedUri": "http://redgatedeploy:81/nuget/", "Links": { "Self": "/api/feeds/feeds-default", "Packages": "/api/feeds/feeds-default/packages" }, "Username": "", "Password": "" }, { "Id": "feeds-1", "Name": "TeamCity", "FeedUri": "http://teamcity:8111/httpAuth/app/nuget/v1/FeedService.svc/", "Links": { "Self": "/api/feeds/feeds-1", "Packages": "/api/feeds/feeds-1/packages" }, "Username": "********", "Password": "********" } ]
How do we configure our build to publish to just the TeamCity feed?
Iain Elder, Skyscanner
Comments
The feeds are ordered in the order that they are created, and there's no way to re-order them in the UI. You can however do it by going to our internal database and changing the order.
Having remote desktoped into the Deployment Manager server, visit http://localhost:10300/raven/studio.htm ... Csystem%3E
Then adjust the SortOrder to be -1, and click Save.
Now if you view the JSON of the list of feeds the TeamCity feed should be at the top.
And that means the TeamCity plugin should push to it. It will probably display a message along the lines of "Skipping package push for repository". Just ignore that message; it should still work even though that message is shown.
Let me/us know how you get on.
Here are the steps I took to resolve the issue.
Move the TeamCity feed to the top of the feed list
Use Remote Desktop Connection to connect to redgatedeploy.
Open this link in Internet Explorer:
http://localhost:10300/raven/studio.htm ... Csystem%3E
Click the Silverlight logo to install Silverlight. Refresh the page after installation.
Change the sort order of the document to -1 and click save.
The RavenDB interface should look like this.
Check that it worked
Go back to your workstation desktop.
Open RGDM package feed API:
http://redgatedeploy:81/api/feeds
You should see the TeamCity feed at the top.
Run the TeamCity build again.
sqlCI should no longer raise an error.
You might see a message like this in the build log:
It's safe to ignore. If the build was successful, the build will be published to the TeamCity package feed.