Clarification on using CI build referencing account packages

Phil Cooper's Avatar

Phil Cooper

28 Mar, 2019 01:37 PM

Hello,

My goal is to have a project that is able to reference other projects (via nuget packages) that are published to the account feed. I actually have projects working where I've manually referenced in the nuget.config, each of the sources for each of the other projects it depends on but this is a maintenance nightmare trying to ensure the projects have the correct sources and i'd rather just use the account feed.

Each attempt has given me "has timed out after 100000ms" which suggests it can't find/use the account.

How do I get a project to use the account feed as a source? I've seen that you can specify (I think) to use the account and project feed as part of the build using (in .yaml):

account_feed: true
project_feed: true

When I do, I see the timeout. I've also tried providing the account in the nuget.config and even adding environment variables (user/pass) so it can access the feed, still the same timeout issue.

I do however, see the account as a nuget source when I print out (nuget sources) as part of the build.

Can anyone help to guide me on doing this and what I might be doing wrong?

regards,
Phil

  1. Support Staff 1 Posted by Owen McDonnell on 28 Mar, 2019 03:36 PM

    Owen McDonnell's Avatar

    I don't know if that was meant as a literal sample from your config but if you are adding those values to you appveyor.yml config file they should be within a nuget: key.
    i.e.

    nuget:
      account_feed: true
      project_feed: true
    
  2. 2 Posted by Phil Cooper on 28 Mar, 2019 07:59 PM

    Phil Cooper's Avatar

    Yes, sorry - they were taken out of context.

    So to be clear, if those options are specified, the build will attempt to pull packages from the account and project feeds if it can't find them in the nuget repository?

    If that is the case, is there anything else that needs to be configured to allow this i.e. credentials in the environment variables?

    Thanks for taking the time to answer.

  3. Support Staff 3 Posted by Owen McDonnell on 29 Mar, 2019 07:02 AM

    Owen McDonnell's Avatar

    Can you try explicitly adding account feed as a nuget source by adding this command to install: stage instead of account_feed: true

    nuget sources add -Name AppVeyorAccount -source https://ci.appveyor.com/nuget/<your-nuget-feed> -UserName %APPVEYOR_USERNAME% -password "%APPVEYOR_PASSWORD%"
    
    with the username/password variables added to environment as secure variables.
  4. 4 Posted by Phil Cooper on 29 Mar, 2019 08:45 AM

    Phil Cooper's Avatar

    Awesome, that's working now, here's the final yml and environment variables added via the settings UI for that project:

    version: 1.0.{build}
    image: Visual Studio 2017
    cache: packages -> **\packages.config
    nuget:
      account_feed: false
      project_feed: false
    before_build:
    - cmd: nuget restore
    install:
      nuget sources add -Name AppVeyorAccount -source https://ci.appveyor.com/nuget/account-feed-name -UserName %APPVEYOR_USERNAME% -password "%APPVEYOR_PASSWORD%"
    build:
      project: project.sln
      publish_nuget: true
      include_nuget_references: true
      verbosity: minimal

    Many thanks for your help & time.

    Phil

  5. Support Staff 5 Posted by Owen McDonnell on 29 Mar, 2019 04:26 PM

    Owen McDonnell's Avatar

    No problem. Thanks for sharing your working solution.

  6. Owen McDonnell closed this discussion on 29 Mar, 2019 04:26 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM