Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clean when running shadowJar in Dockerfile #2145

Merged
merged 4 commits into from
Sep 27, 2022

Conversation

wslulciuc
Copy link
Member

@wslulciuc wslulciuc commented Sep 26, 2022

Problem

PR #2032 introduced MARQUEZ_VERSION in entrypoint.sh to avoid the case when multiple JARs are located under the directory api/build/libs/. When building the docker image for the API, we copy over the directory api/ in its entirety. This results in (possibly) multiple JARs with the following error:

marquez-ap   | invalid choice: 'marquez-api-0.27.1-SNAPSHOT.jar' (choose from 'server', 'check', 'metadata', 'seed')
marquez-api  | usage: java -jar marquez-api-0.27.0-SNAPSHOT.jar

Solution

When building the API docker image, use clean when building the shadow JAR:

 $ ./gradlew clean :api:shadowJar

This will ensure the directory api/build/libs/ is cleaned before building the JAR again. This PR also updates .dockerignore to ignore api/build/*.

Checklist

  • You've signed-off your work
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've updated the CHANGELOG.md with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)
  • You've included a header in any source code files (if relevant)

@boring-cyborg boring-cyborg bot added the docker label Sep 26, 2022
@wslulciuc wslulciuc added the review Ready for review label Sep 26, 2022
@wslulciuc wslulciuc marked this pull request as ready for review September 26, 2022 22:25
@wslulciuc wslulciuc enabled auto-merge (squash) September 26, 2022 22:26
@codecov
Copy link

codecov bot commented Sep 26, 2022

Codecov Report

Merging #2145 (2de4352) into main (5e47e0e) will not change coverage.
The diff coverage is n/a.

❗ Current head 2de4352 differs from pull request most recent head 564ebf6. Consider uploading reports for the commit 564ebf6 to get more accurate results

@@            Coverage Diff            @@
##               main    #2145   +/-   ##
=========================================
  Coverage     75.30%   75.30%           
  Complexity     1038     1038           
=========================================
  Files           203      203           
  Lines          4883     4883           
  Branches        399      399           
=========================================
  Hits           3677     3677           
  Misses          763      763           
  Partials        443      443           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wslulciuc wslulciuc merged commit 0a3e3e7 into main Sep 27, 2022
@wslulciuc wslulciuc deleted the feature/run-clean-with-shadowjar-in-dockerfile branch September 27, 2022 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker review Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants