From 05d377d534363b5ab84677691c2dae5282653aa5 Mon Sep 17 00:00:00 2001 From: Shawn Hurley Date: Wed, 29 Nov 2023 10:17:30 -0500 Subject: [PATCH] :bug: adding entrypoint to copy source from mount to container Signed-off-by: Shawn Hurley --- Dockerfile | 1 + cmd/analyze.go | 2 +- entrypoint.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 54593c0..9c8e6fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,5 +40,6 @@ COPY --from=rulesets /rulesets/default/generated /opt/rulesets COPY --from=rulesets /windup-rulesets/rules/rules-reviewed/openrewrite /opt/openrewrite COPY --from=static-report /usr/bin/js-bundle-generator /usr/local/bin COPY --from=static-report /usr/local/static-report /usr/local/static-report +COPY entrypoint.sh /usr/bin/entrypoint.sh ENTRYPOINT ["kantra"] diff --git a/cmd/analyze.go b/cmd/analyze.go index ef8fa14..d8138f7 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -638,7 +638,7 @@ func (a *analyzeCommand) RunAnalysis(ctx context.Context, xmlOutputDir string) e WithStdout(analysisLog), WithStderr(analysisLog), WithEntrypointArgs(args...), - WithEntrypointBin("/usr/bin/konveyor-analyzer"), + WithEntrypointBin("/usr/bin/entrypoint.sh"), WithCleanup(a.cleanup), ) if err != nil { diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..28bb9df --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -x + +cp -r /opt/input/source /tmp/source-code +sed -i 's/\/opt\/input\/source/\/tmp\/source-code/g' /opt/input/config/settings.json +#/usr/bin/konveyor-analyzer --provider-settings=/opt/input/config/settings.json --rules=/opt/rulesets/ --output-file=/opt/output/output.yaml --context-lines=100 --dep-label-selector='(!konveyor.io/dep-source=open-source)' --verbose=4 --label-selector='((konveyor.io/target=quarkus || konveyor.io/target=jakarta-ee || konveyor.io/target=jakarta-ee8+ || konveyor.io/target=jakarta-ee9+ || konveyor.io/target=cloud-readiness) && konveyor.io/source) || (discovery)' +/usr/bin/konveyor-analyzer "$@" +sed -i 's/\/tmp\/source-code/\/opt\/input\/source/g' /opt/input/config/settings.json