Skip to content

Commit

Permalink
Copy openrewrite source from mount to container (konveyor#173)
Browse files Browse the repository at this point in the history
copy openrewrite source from mount to container

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored and pranavgaikwad committed Mar 12, 2024
1 parent dd3fe5a commit d363be1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ RUN CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -o windows-kantra main.g

FROM quay.io/konveyor/analyzer-lsp:latest

<<<<<<< HEAD
RUN mkdir /opt/rulesets /opt/rulesets/input /opt/rulesets/convert /opt/openrewrite /opt/input /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
>>>>>>> eb4a81f (Copy openrewrite source from mount to container (#173))

COPY --from=builder /workspace/kantra /usr/local/bin/kantra
COPY --from=builder /workspace/darwin-kantra /usr/local/bin/darwin-kantra
Expand All @@ -40,6 +44,11 @@ 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
<<<<<<< HEAD
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
>>>>>>> eb4a81f (Copy openrewrite source from mount to container (#173))

ENTRYPOINT ["kantra"]
4 changes: 2 additions & 2 deletions cmd/openrewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,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 {
Expand Down
6 changes: 6 additions & 0 deletions openrewrite_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d363be1

Please sign in to comment.