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
-
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.
-
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, and4
will be the latest stable of4.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.
-
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