diff --git a/src/main/scala/io/sdkman/changelogs/KarafMigrations.scala b/src/main/scala/io/sdkman/changelogs/KarafMigrations.scala index 3d307497..26b03ced 100644 --- a/src/main/scala/io/sdkman/changelogs/KarafMigrations.scala +++ b/src/main/scala/io/sdkman/changelogs/KarafMigrations.scala @@ -2,18 +2,53 @@ package io.sdkman.changelogs import com.github.mongobee.changeset.{ChangeLog, ChangeSet} import com.mongodb.client.MongoDatabase +import org.bson.Document @ChangeLog(order = "025") class KarafMigrations { - @ChangeSet(order = "001", id = "001_add_karaf_candidate", author = "tonit") - def migration001(implicit db: MongoDatabase): Candidate = { - Candidate( - candidate = "karaf", - name = "Karaf", - description = - "Apache Karaf is a polymorphic, lightweight, powerful, and enterprise ready applications runtime. It provides all the ecosystem and bootstrapping options you need for your applications. It runs on premise or on cloud. By polymorphic, it means that Karaf can host any kind of applications: WAR, OSGi, Spring, and much more.", - websiteUrl = "https://karaf.apache.org/" - ).insert() + val CandidateName = "karaf" + + @ChangeSet( + order = "003", + id = "003-add_new_karaf_versions_and_update_default", + author = "fcolinet" + ) + def migration003(implicit db: MongoDatabase): Document = { + List( + "4.4.3", + "4.4.2", + "4.4.1", + "4.4.0", + "4.3.9", + "4.3.8", + "4.3.7", + "4.3.6", + "4.3.5", + "4.3.4", + "4.3.3", + "4.3.2", + "4.3.1", + "4.3.0", + "4.2.16", + "4.2.15", + "4.2.14", + "4.2.13", + "4.2.12", + "4.2.11", + "4.2.10", + "4.2.9" + ).map( + version => + Version( + candidate = CandidateName, + version = version, + url = + s"https://archive.apache.org/dist/karaf/$version/apache-karaf-$version.tar.gz" + ) + ) + .validate() + .insert() + setCandidateDefault(CandidateName, "4.4.3") } }