Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    ProGet: include a Universal Package feed in a nuget config file?

    Scheduled Pinned Locked Moved Support
    6 Posts 2 Posters 15 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MaxCasconeM Offline
      MaxCascone
      last edited by

      We are in the process of adopting ProGet as our one-stop-shop for internal package management. We are using it as a build artifact store, and we pull from it to do deploys. Now, i am onboarding an app that consumes another app's build as part of its build. The consumee is already published as a Universal Package to ProGet.

      I'm wondering if there's a way to add this package as-is to the consumer's packages.config file, so that it gets pulled down by a nuget restore? This would avoid having to build a separate step that pulls the package to consume.

      1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer
        last edited by

        Hi @mcascone, I'm afraid it's not possible.

        nuget or dotnet nuget tools only understand the NuGet Package Format, and the NuGet API, so there's no way for the tools to use different formats or different APIs...

        1 Reply Last reply Reply Quote 1
        • MaxCasconeM Offline
          MaxCascone
          last edited by MaxCascone

          Thanks for the reply, that's pretty much what i figured, but it's always worth asking.

          What i built at least as a first effort is: add an optional consumes parameter to the pipeline/Jenkinsfile, specifying the packages(s) to pull from ProGet as feedname:groupname:packagename:

          • Jenkinsfile:
          library 'my-shared-library'
          
          sharedPipeline {
          // ...
            consumes = 'myFeed:myGroup:myPackage'
          // ...
          }
          
          
          • In the file that manages restoring prior to jenkins builds:
          // if this repo consumes another package(s) from ProGet, get it here.
          // The required syntax of 'consumes' is: 'proget_feedName:groupName:packageName'
          // comma separate multiple packages
            if(env.consumes) {
              // create a [list] to support multiple packages
              env.consumes.split(/\s*,\s*/).each {
                downloadFromProget(it)
              }
            }
          
          • downloadFromProget.groovy:
          // common defaults
          // Note that downloadProgetPackage seems to require a literal path - hence the {WORKSPACE}
            dlFolder  = "${WORKSPACE}/${env.packageDownloadDir}"
            ver = 'Latest'
          
          //... a bunch of other custom patterns to download specific stuff ...
          
          // packages to consume from ProGet need to come in as feedName:groupName:packageName
          // check that it matches that syntax with regex (.+ means 1 or more of any char)
              else if (app ==~ /.+:.+:.+/)
                pkgMap  = app.split(':')
                fdName  = pkgMap[0]
                gpName  = pkgMap[1]
                pkgName = pkgMap[2]
                expFolder = "${WORKSPACE}/${pkgName}"
              }
          
          // then download
          
          downloadProgetPackage downloadFolder: dlFolder, 
              downloadFormat: 'zip',
              feedName:       fdName,
              groupName:      gpName,
              packageName:    pkgName,
              version:        ver
          

          The last thing i've yet to do is change all my package pulling to use the unpack mode of downloading from proget, so i can remove the unzipping steps on my side.

          1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer
            last edited by

            That's great thanks for sharing!! We want to build a content backlog, and will add this to it -- at least a way to download from jenkins in this manner. nice find :)

            1 Reply Last reply Reply Quote 0
            • MaxCasconeM Offline
              MaxCascone
              last edited by

              I just noticed this in the ProGet Jenkins plugin docs:

              dependencies (optional)

              An array of strings, each consisting of a package identification string; this string is formatted as follows:

              �group�:�package-name�

              �group�:�package-name�:�version�

              When the version is not specified, the latest is used.

              Type: String

              This is for the upload parameters. I don't remember seeing this before, is this new, and/or related to my consumes pattern?

              atrippA 1 Reply Last reply Reply Quote 0
              • atrippA Offline
                atripp inedo-engineer @MaxCascone
                last edited by

                @mcascone I don't think it's new, but it's just used to specify the dependencies field in the manifest file; I'm thinking, perhaps, it might be similar/identical to the consumes field you added?

                https://docs.inedo.com/docs/upack-universal-packages-manifest

                The only thing Inedo tools use it for today is just displaying information in ProGet, on the dependencies tab. That may / may not be helpful.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation