diff --git a/Dockerfile b/Dockerfile index dda683e..166939f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build --ldflags="-X 'github.com/k FROM quay.io/konveyor/analyzer-lsp:latest -RUN mkdir /opt/rulesets /opt/rulesets/input /opt/rulesets/convert /opt/openrewrite /opt/input /opt/input/rules /opt/input/rules/custom /opt/output /opt/xmlrules /opt/shimoutput +RUN mkdir /opt/rulesets /opt/rulesets/input /opt/rulesets/convert /opt/openrewrite /opt/input /opt/input/rules /opt/input/rules/custom /opt/output /opt/xmlrules /opt/shimoutput /tmp/source-app /tmp/source-app/input COPY --from=builder /workspace/kantra /usr/local/bin/kantra COPY --from=builder /workspace/darwin-kantra /usr/local/bin/darwin-kantra @@ -42,6 +42,7 @@ 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 +COPY --chmod=755 entrypoint.sh /usr/bin/entrypoint.sh +COPY --chmod=755 openrewrite_entrypoint.sh /usr/bin/openrewrite_entrypoint.sh ENTRYPOINT ["kantra"] diff --git a/cmd/openrewrite.go b/cmd/openrewrite.go index 6152115..b9e840d 100644 --- a/cmd/openrewrite.go +++ b/cmd/openrewrite.go @@ -154,9 +154,9 @@ func (o *openRewriteCommand) Run(ctx context.Context) error { err := NewContainer(o.log).Run( ctx, WithEntrypointArgs(args...), - WithEntrypointBin("/usr/bin/mvn"), + WithEntrypointBin("/usr/bin/openrewrite_entrypoint.sh"), WithVolumes(volumes), - WithWorkDir(InputPath), + WithWorkDir("/tmp/source-app/input"), WithCleanup(o.cleanup), ) if err != nil { diff --git a/openrewrite_entrypoint.sh b/openrewrite_entrypoint.sh new file mode 100644 index 0000000..0596012 --- /dev/null +++ b/openrewrite_entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -x + +cp -r /opt/input /tmp/source-app +/usr/bin/mvn "$@" +cp -r /tmp/source-app/input /opt