Add Dockerfile and GitHub workflow generators to Gradle plugin#2
Draft
Add Dockerfile and GitHub workflow generators to Gradle plugin#2
Conversation
Add GenerateDockerfileTask that generates a Dockerfile with configurable base image, port, and JVM args for microservice projects. Add GenerateWorkflowTask that generates a GitHub Actions workflow for CI/CD including Maven publishing, Docker image build/push to GHCR, and GitHub Release creation. Register both tasks in MicroservicePlugin as 'generateDockerfile' and 'generateWorkflow'. Agent-Logs-Url: https://github.com/SLNE-Development/surf-microservice/sessions/2eed8838-a00c-48de-827e-00e0d2c52fa4 Co-authored-by: ammodev <32338899+ammodev@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ammodev
March 29, 2026 11:47
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two code generation tasks to the microservice Gradle plugin: one for producing a Dockerfile, another for a full CI/CD GitHub Actions workflow that builds, publishes, creates Docker images, and cuts GitHub releases.
New tasks
generateDockerfile— Emits a Dockerfile with configurablebaseImage,port, andjvmArgs. Copies the shadow JAR (*-all.jar) into a GraalVM-based image by default.generateWorkflow— Emits.github/workflows/publish.ymlwith the full pipeline: Gradle build → checks → Maven publish → Docker build+push to GHCR → GitHub Release with JAR artifacts. Supports optionalmoduleRegexfor filtering release JARs.Usage
Files changed
task/GenerateDockerfileTask.kt— New abstract task with@Input/@OutputFilepropertiestask/GenerateWorkflowTask.kt— New abstract task generating workflow YAML with Docker build/push, version extraction, release flag logic, andsoftprops/action-gh-releaseMicroservicePlugin.kt— Registers both tasks with conventions