Skip to content

Commit

Permalink
👻 Make bundles location a config setting (#144)
Browse files Browse the repository at this point in the history
👻 make bundles location a config setting

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
  • Loading branch information
pranavgaikwad authored Jan 15, 2024
1 parent b2517f7 commit e1028ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) {
Location: SourceMountPath,
AnalysisMode: provider.AnalysisMode(a.mode),
ProviderSpecificConfig: map[string]interface{}{
"bundles": "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar",
"bundles": JavaBundlesLocation,
"depOpenSourceLabelsFile": "/usr/local/etc/maven.default.index",
provider.LspServerPathConfigKey: "/jdtls/bin/jdtls",
},
Expand Down Expand Up @@ -468,9 +468,9 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) {
// Set proxy to providers
if a.httpProxy != "" || a.httpsProxy != "" {
proxy := provider.Proxy{
HTTPProxy: a.httpProxy,
HTTPProxy: a.httpProxy,
HTTPSProxy: a.httpsProxy,
NoProxy: a.noProxy,
NoProxy: a.noProxy,
}
for i := range provConfig {
provConfig[i].Proxy = &proxy
Expand Down
1 change: 1 addition & 0 deletions cmd/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
XMLRulePath = "/opt/xmlrules"
ShimOutputPath = "/opt/shimoutput"
CustomRulePath = "/opt/input/rules"
JavaBundlesLocation = "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar"
)

type Config struct {
Expand Down
2 changes: 2 additions & 0 deletions hack/update-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

image="${IMAGE:-quay.io/konveyor/kantra}"
name="${NAME:-kantra}"
bundle="${BUNDLE:-/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar}"

sed -i \
-e "s,\(RootCommandName *string.*default:\"\)[^\"]*\",\1$name\"," \
-e "s,\(RunnerImage *string.*default:\"\)[^\"]*\",\1$image\"," \
-e "s,\(JavaBundlesLocation *= *\"\)[^\"]*\",\1$bundle\"," \
./cmd/settings.go

0 comments on commit e1028ae

Please sign in to comment.