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!

    Support for Querying Versions

    Scheduled Pinned Locked Moved Support
    3 Posts 3 Posters 18 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.
    • C Offline
      casey.entzi_8419
      last edited by

      We are looking at potentially using proget to manage both docker images and generic tar.gz archives along with some .net and java developer libraries (nuget/maven).

      This question is more around the first part, once we push up docker images and the archives with the appropriate version data (or tag in docker).

      Is there a way to say, give the latest version that starts with '1.0.', so if you had the following versions/tags, 1.0.1, 1.0.2, 1.0.3, 1.1.1, 1.1.4, it would come back with 1.0.3?

      However, if I asked for the latest version of '1.' it would give me 1.1.4?

      JFrog Artifactory supports this type of api and that's what proget would be replacing. With artifactory, you just put and asterisk in there to denote the wildcard part.

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

        ProGet has a really cool feature called Semantic Versioning for Docker Container Images, and it works pretty much how you described, but it also enforces that containers have a valid semantic version tag. For example, latest will always refer to the highest, stable-version of a container, and 4 will be the latest stable of 4.x.y

        As for "generic archives", check out Universal Packages - they're really powerful, and are like "nuget/maven" but for your own applications and components, and extensible.

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

          FWIW, i'm using the Versions API endpoint to get the list of versions, and you could build your own parsing from there. I'm sure this is mostly wrong, but this is what I'm doing, in Jenkins:

          // get latest version of package on proget
          // https://docs.inedo.com/docs/upack/feed-api/endpoints#list-versions
          // compare to build's versionfile
          def response = httpRequest ignoreSslErrors: true, 
                         url: "${env.progetUrl}/${env.progetFeedType}/${env.feedName}/versions?group=${env.groupName}&name=${env.serviceName}", 
                         wrapAsMultipart: false    
          
          def content  = readJSON text: response.getContent()
          
          // Versions are always returned as an array, even if count = 1
          // So just always get the last element in the array.
          env.latestVersion = content.version[-1]
          
          echo "Latest published version is ${env.latestVersion}, date: ${content.published[-1]}"
          echo "Jenkins is building version: ${env.tag}"
          
          // compareResult returns:
          // -1 if v1 < v2
          // 0  if v1 == v2
          // 1  if v1 > v2
          compareResult = compareVersions v1: env.latestVersion, v2: env.tag
          
          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