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

Regenerate docker files command #36178

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

iocanel
Copy link
Contributor

@iocanel iocanel commented Sep 27, 2023

No description provided.

@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform labels Sep 27, 2023
@iocanel
Copy link
Contributor Author

iocanel commented Sep 27, 2023

@ia3andy: This is a draft of what we discussed the other day. Any feedback / suggestion is more than welcome.

@iocanel
Copy link
Contributor Author

iocanel commented Sep 28, 2023

cc @maxandersen

@ia3andy
Copy link
Contributor

ia3andy commented Sep 28, 2023

@iocanel here are some suggestions:

To pass the data use this:

QuarkusCodestartProjectInput.builder()
    .putData(QuarkusDataKey.PROJECT_ARTIFACT_ID, artifactId)
    .putData(QuarkusDataKey.JAVA_VERSION, javaVersion)

@iocanel
Copy link
Contributor Author

iocanel commented Oct 2, 2023

  • I think we should split the dockerfile codestarts to allow choosing which dockerfile we want to generate.

Do we have to split them? Can't we just configure using the map of build strategies to ignore the files we don't really need?

@gsmet
Copy link
Member

gsmet commented Oct 6, 2023

Oh, I missed that one, that would be very nice if we could actually have it!

@ia3andy
Copy link
Contributor

ia3andy commented Oct 9, 2023

  • I think we should split the dockerfile codestarts to allow choosing which dockerfile we want to generate.

Do we have to split them? Can't we just configure using the map of build strategies to ignore the files we don't really need?

I am not sure I get what you mean.

FYI, currently there is no way to control whether a file is generated or not, we could introduce it.

@iocanel
Copy link
Contributor Author

iocanel commented Oct 9, 2023

  • I think we should split the dockerfile codestarts to allow choosing which dockerfile we want to generate.

Do we have to split them? Can't we just configure using the map of build strategies to ignore the files we don't really need?

I am not sure I get what you mean.

FYI, currently there is no way to control whether a file is generated or not, we could introduce it.

What I had in mind is something like:

      Map<String, String> spec = new HashMap<>();
      spec.put("*", "replace");

And use ignore or something like this for the patterns we want to skip.

BTW, I am not sure I am able to see how I can grab the maven coordinates for the QuarkusProject, any hints?

@@ -28,7 +28,6 @@ public void process(Path targetDirectory, String relativePath, List<TargetFile>
throws IOException {
checkNotEmptyCodestartFiles(codestartFiles);
final Path targetPath = targetDirectory.resolve(relativePath);
checkTargetDoesNotExist(targetPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because, this throws an exception preventing the actual file replacement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be the case as the file shouldn't exist before this is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and throwing an exception if file exists doesn't sound like replace to me.

What do I miss?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look just bellow the replace is working by using the latest file in the List

@iocanel iocanel force-pushed the docker-gen branch 2 times, most recently from 9f5bd14 to e25f650 Compare October 13, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants