mirror of
https://github.com/Graylog2/graylog-project-cli.git
synced 2026-03-13 08:02:57 +08:00
Handle the "jvm_version" manifest attribute
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
const DownloadedManifestPrefix = "downloaded-manifest"
|
||||
|
||||
type Manifest struct {
|
||||
JVMVersion int `json:"jvm_version,omitzero"`
|
||||
Modules []ManifestModule `json:"modules"`
|
||||
Includes []string `json:"includes,omitempty"`
|
||||
DefaultApply ManifestApply `json:"default_apply,omitempty"`
|
||||
|
||||
@@ -20,6 +20,7 @@ type Project struct {
|
||||
Server Module
|
||||
Modules []Module
|
||||
AssemblyPlatforms []string
|
||||
JVMVersion int
|
||||
}
|
||||
|
||||
type Apply struct {
|
||||
@@ -276,6 +277,7 @@ func New(config config.Config, manifestFiles []string, options ...projectOption)
|
||||
Server: server,
|
||||
Modules: projectModules,
|
||||
AssemblyPlatforms: readManifest.AssemblyPlatforms,
|
||||
JVMVersion: readManifest.JVMVersion,
|
||||
}
|
||||
|
||||
return project
|
||||
|
||||
@@ -18,6 +18,7 @@ type TemplateInventory struct {
|
||||
Dependencies []p.Module
|
||||
Assemblies map[string][]Assembly
|
||||
AssemblyPlatforms []string
|
||||
JVMVersion int
|
||||
}
|
||||
|
||||
type Assembly struct {
|
||||
@@ -75,12 +76,14 @@ func WriteXmlFile(config config.Config, project p.Project, templateFile string,
|
||||
Dependencies: p.MavenDependencies(project),
|
||||
Assemblies: mavenAssemblies(project),
|
||||
AssemblyPlatforms: project.AssemblyPlatforms,
|
||||
JVMVersion: project.JVMVersion,
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
|
||||
if err := tmpl.Execute(&buf, &inventory); err != nil {
|
||||
logger.Fatal("Unable to execute template: %v", err)
|
||||
logger.Error("Unable to execute template: %v", err)
|
||||
logger.Fatal("Please make sure you are running the latest version. Use the `self-update` command to update the CLI.")
|
||||
}
|
||||
|
||||
if err := os.WriteFile(outputFile, buf.Bytes(), 0644); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user