Compare release versions by package creation date
This commit is contained in:
parent
2be5da93e2
commit
5a61749aea
|
@ -61,7 +61,7 @@ public class Inceptum {
|
|||
}
|
||||
}
|
||||
if (cmd == null) {
|
||||
System.out.println("Command not found");
|
||||
System.out.println("Command not found: " + arg.command);
|
||||
return;
|
||||
}
|
||||
if (cmd.enableLog()) {
|
||||
|
|
|
@ -25,17 +25,19 @@ public class UpdateChecker {
|
|||
GitlabProject project = GitlabApi.getProject(PROJECT_ID);
|
||||
PackageInfo experimental = null;
|
||||
PackageInfo stable = null;
|
||||
packageIter: for (PackageInfo info : GitlabApi.getPackages(project)) {
|
||||
if (info.status.equals("default"))
|
||||
for (PackageInfo info : GitlabApi.getPackages(project)) {
|
||||
if (info.status.equals("default")) {
|
||||
for (Pipeline pipeline : info.pipelines) {
|
||||
if (pipeline.ref.equals("master") && pipeline.status.equals("success")) {
|
||||
if (experimental == null) experimental = info;
|
||||
if (!info.version.contains("+")) {
|
||||
if (experimental == null || experimental.created_at.compareTo(pipeline.created_at) < 0) {
|
||||
experimental = info;
|
||||
}
|
||||
if (!info.version.contains("+") && (stable == null || stable.created_at.compareTo(pipeline.created_at) < 0)) {
|
||||
stable = info;
|
||||
break packageIter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (experimental == null) {
|
||||
throw new IOException("No version could be found");
|
||||
|
|
Loading…
Reference in New Issue