Skip to content

Commit

Permalink
🐛 adding entrypoint to copy source from mount to container
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley committed Nov 29, 2023
1 parent 888433a commit 05d377d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 05d377d

Please sign in to comment.