mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 11:36:05 +01:00
(refs #1777) Bump gist plugin to 4.11.0
This commit is contained in:
10
build.sbt
10
build.sbt
@@ -160,14 +160,10 @@ executableKey := {
|
|||||||
IO copyFile(Keys.baseDirectory.value / "plugins.json", pluginsDir / "plugins.json")
|
IO copyFile(Keys.baseDirectory.value / "plugins.json", pluginsDir / "plugins.json")
|
||||||
|
|
||||||
val json = IO read(Keys.baseDirectory.value / "plugins.json")
|
val json = IO read(Keys.baseDirectory.value / "plugins.json")
|
||||||
PluginsJson.parse(json).foreach { case (plugin, version) =>
|
PluginsJson.parse(json).foreach { case (plugin, version, file) =>
|
||||||
val url = if(plugin == "gitbucket-pages-plugin"){
|
val url = s"https://github.com/gitbucket/${plugin}/releases/download/${version}/${file}"
|
||||||
s"https://github.com/gitbucket/${plugin}/releases/download/v${version}/${plugin}_${scalaBinaryVersion.value}-${version}.jar"
|
|
||||||
} else {
|
|
||||||
s"https://github.com/gitbucket/${plugin}/releases/download/${version}/${plugin}_${scalaBinaryVersion.value}-${version}.jar"
|
|
||||||
}
|
|
||||||
log info s"Download: ${url}"
|
log info s"Download: ${url}"
|
||||||
IO transfer(new java.net.URL(url).openStream, pluginsDir / s"${plugin}_${scalaBinaryVersion.value}-${version}.jar")
|
IO transfer(new java.net.URL(url).openStream, pluginsDir / file)
|
||||||
}
|
}
|
||||||
|
|
||||||
// zip it up
|
// zip it up
|
||||||
|
|||||||
@@ -31,9 +31,9 @@
|
|||||||
"description": "Provides Gist feature on GitBucket.",
|
"description": "Provides Gist feature on GitBucket.",
|
||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"version": "4.10.0",
|
"version": "4.11.0",
|
||||||
"range": ">=4.15.0",
|
"range": ">=4.19.0",
|
||||||
"file": "gitbucket-gist-plugin_2.12-4.10.0.jar"
|
"file": "gitbucket-gist-plugin-assembly-4.11.0.jar"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default": false
|
"default": false
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"description": "Project pages for gitbucket",
|
"description": "Project pages for gitbucket",
|
||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"version": "1.5.0",
|
"version": "v1.5.0",
|
||||||
"range": ">=4.15.0",
|
"range": ">=4.15.0",
|
||||||
"file": "gitbucket-pages-plugin_2.12-1.5.0.jar"
|
"file": "gitbucket-pages-plugin_2.12-1.5.0.jar"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,17 @@ import scala.collection.JavaConverters._
|
|||||||
|
|
||||||
object PluginsJson {
|
object PluginsJson {
|
||||||
|
|
||||||
def parse(json: String): Seq[(String, String)] = {
|
def parse(json: String): Seq[(String, String, String)] = {
|
||||||
val value = Json.parse(json)
|
val value = Json.parse(json)
|
||||||
value.asArray.values.asScala.map { plugin =>
|
value.asArray.values.asScala.map { plugin =>
|
||||||
val obj = plugin.asObject.get("versions").asArray.asScala.head.asObject
|
val pluginObject = plugin.asObject
|
||||||
val pluginName = obj.get("file").asString.split("_2.12-").head
|
val pluginName = "gitbucket-" + pluginObject.get("id").asString + "-plugin"
|
||||||
val version = obj.get("version").asString
|
|
||||||
(pluginName, version)
|
val latestVersionObject = pluginObject.get("versions").asArray.asScala.head.asObject
|
||||||
|
val file = latestVersionObject.get("file").asString
|
||||||
|
val version = latestVersionObject.get("version").asString
|
||||||
|
|
||||||
|
(pluginName, version, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user