Skip to content

Use clean when running shadowJar in Dockerfile#2145

Merged
wslulciuc merged 4 commits into
mainfrom
feature/run-clean-with-shadowjar-in-dockerfile
Sep 27, 2022
Merged

Use clean when running shadowJar in Dockerfile#2145
wslulciuc merged 4 commits into
mainfrom
feature/run-clean-with-shadowjar-in-dockerfile

Conversation

@wslulciuc

@wslulciuc wslulciuc commented Sep 26, 2022

Copy link
Copy Markdown
Member

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)

Signed-off-by: wslulciuc <willy@datakin.com>
Signed-off-by: wslulciuc <willy@datakin.com>
@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

codecov Bot commented Sep 26, 2022

Copy link
Copy Markdown

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

Signed-off-by: wslulciuc <willy@datakin.com>
@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
jonathanpmoraes referenced this pull request in nubank/NuMarquez Feb 6, 2025
* Add clean to build cmd for docker

Signed-off-by: wslulciuc <willy@datakin.com>

* Remove MARQUEZ_VERSION usage in docker/entrypoint.sh

Signed-off-by: wslulciuc <willy@datakin.com>

Signed-off-by: wslulciuc <willy@datakin.com>
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