From 0773651198948021a4d343e0c79b4c5dc2e14c76 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 | 7 +++++++ 3 files changed, 9 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..db205e1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/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 `"$@"` +sed -i 's|/tmp/source-code|/opt/input/source|g' /opt/input/config/settings.json