Skip to content

Commit

Permalink
Vendor namespace in config
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Nov 15, 2024
1 parent 6e0797b commit 80d0a84
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
23 changes: 11 additions & 12 deletions pkg/cfg/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ func (c *Config) setDefaults() {
v.SetDefault("output.log.mode", OutputLogConsole)
v.SetDefault("output.query", "")

v.SetDefault("java.home_dir", "")
v.SetDefault("java.version_constraints", ">= 11, < 12")
v.SetDefault("java.download.url", c.tplString("https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_[[.Arch]]_[[.Os]]_hotspot_11.0.25_9.[[.ArchiveExt]]"))
v.SetDefault("java.download.replacements", map[string]string{"darwin": "mac", "x86_64": "x64", "amd64": "x64", "386": "x86-32", "arm64": "x64", "aarch64": "x64"})
v.SetDefault("vendor.quickstart.dist_file", common.LibDir+"/{aem-sdk,cq-quickstart}-*.{zip,jar}")
v.SetDefault("vendor.quickstart.license_file", common.LibDir+"/license.properties")

v.SetDefault("vault.download_url", "https://repo1.maven.org/maven2/org/apache/jackrabbit/vault/vault-cli/3.8.2/vault-cli-3.8.2-bin.tar.gz")
v.SetDefault("vendor.java.home_dir", "")
v.SetDefault("vendor.java.version_constraints", ">= 11, < 12")
v.SetDefault("vendor.java.download.url", c.tplString("https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_[[.Arch]]_[[.Os]]_hotspot_11.0.25_9.[[.ArchiveExt]]"))
v.SetDefault("vendor.java.download.replacements", map[string]string{"darwin": "mac", "x86_64": "x64", "amd64": "x64", "386": "x86-32", "arm64": "x64", "aarch64": "x64"})

v.SetDefault("vendor.oak_run.download_url", "https://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/1.72.0/oak-run-1.72.0.jar")
v.SetDefault("vendor.oak_run.store_path", "crx-quickstart/repository/segmentstore")

v.SetDefault("vendor.vault.download_url", "https://repo1.maven.org/maven2/org/apache/jackrabbit/vault/vault-cli/3.8.2/vault-cli-3.8.2-bin.tar.gz")

v.SetDefault("instance.processing_mode", instance.ProcessingAuto)

Expand Down Expand Up @@ -86,16 +92,9 @@ func (c *Config) setDefaults() {
v.SetDefault("instance.local.tool_dir", common.ToolDir)
v.SetDefault("instance.local.unpack_dir", common.VarDir+"/instance")
v.SetDefault("instance.local.override_dir", common.DefaultDir+"/"+common.VarDirName+"/instance")

v.SetDefault("instance.local.quickstart.dist_file", common.LibDir+"/{aem-sdk,cq-quickstart}-*.{zip,jar}")
v.SetDefault("instance.local.quickstart.license_file", common.LibDir+"/license.properties")

v.SetDefault("instance.local.await_strict", true)
v.SetDefault("instance.local.service_mode", false)

v.SetDefault("instance.local.oak_run.download_url", "https://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/1.72.0/oak-run-1.72.0.jar")
v.SetDefault("instance.local.oak_run.store_path", "crx-quickstart/repository/segmentstore")

v.SetDefault("instance.status.timeout", time.Millisecond*500)

v.SetDefault("instance.package.upload_optimized", true)
Expand Down
8 changes: 4 additions & 4 deletions pkg/java_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func NewJavaManager(manager *VendorManager) *JavaManager {
return &JavaManager{
vendorManager: manager,

HomeDir: cv.GetString("java.home_dir"),
DownloadURL: cv.GetString("java.download.url"),
DownloadURLReplacements: cv.GetStringMapString("java.download.replacements"),
VersionConstraints: cv.GetString("java.version_constraints"),
HomeDir: cv.GetString("vendor.java.home_dir"),
DownloadURL: cv.GetString("vendor.java.download.url"),
DownloadURLReplacements: cv.GetStringMapString("vendor.java.download.replacements"),
VersionConstraints: cv.GetString("vendor.java.version_constraints"),
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/local_instance_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ func NewQuickstart(manager *VendorManager) *Quickstart {
cfg := manager.aem.config.Values()

return &Quickstart{
DistFile: cfg.GetString("instance.local.quickstart.dist_file"),
LicenseFile: cfg.GetString("instance.local.quickstart.license_file"),
DistFile: cfg.GetString("vendor.quickstart.dist_file"),
LicenseFile: cfg.GetString("vendor.quickstart.license_file"),
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/oak_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func NewOakRun(vendorManager *VendorManager) *OakRun {
return &OakRun{
vendorManager: vendorManager,

DownloadURL: cv.GetString("instance.local.oak_run.download_url"),
StorePath: cv.GetString("instance.local.oak_run.store_path"),
DownloadURL: cv.GetString("vendor.oak_run.download_url"),
StorePath: cv.GetString("vendor.oak_run.store_path"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/vault_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func NewVaultCLI(vendorManager *VendorManager) *VaultCLI {
return &VaultCLI{
vendorManager: vendorManager,

DownloadURL: cv.GetString("vault.download_url"),
DownloadURL: cv.GetString("vendor.vault.download_url"),
}
}

Expand Down

0 comments on commit 80d0a84

Please sign in to comment.