Publish Docker image from Create Release workflow - #12714
Conversation
Test plan (before / after merge)Prerequisite (blocking)Configure the two repository secrets on
Safe end-to-end testRuns the real
Cleanup
After mergeOnce merged, the |
Ports the Jenkins MapStore2 stable docker release job into the create_release.yml GitHub Action: adds a docker job that reuses the built war artifact and builds/pushes geosolutionsit/mapstore2.
4518611 to
108b4f0
Compare
Description
Ports the Jenkins MapStore2 Stable Releaser Docker job into the
Create ReleaseGitHub Action (.github/workflows/create_release.yml), so the release Docker image is built and pushed to Docker Hub (geosolutionsit/mapstore2) directly from the release workflow instead of a separate Jenkins pipeline.The new
dockerjob reuses themapstore.waralready produced by the existingbuildjob (no second build), then builds and pushes the image, replicating the Jenkins step:Dockerfileat repo root, context.,--no-cacheMAPSTORE_WEBAPP_SRC=./product/target/mapstore.wargeosolutionsit/mapstore2:<version>and (optionally):latestAn input
dockerTagLatest(defaulttrue) controls whetherlatestis also pushed — the Jenkins job always pushedlatest; this lets us disable it for patch releases of older stable branches so they don't overwritelatest.The
Docker imageentry in the generated release notes now shows thedocker pull geosolutionsit/mapstore2:<version>command instead of the manualTODO(a tags/search URL is avoided on purpose: its prefix match would expose the internal-stabletag).Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
The release Docker image (
geosolutionsit/mapstore2) is built and published by a separate Jenkins job (MapStore2 Stable Releaser), decoupled from the GitHubCreate Releaseworkflow. The release notes contain a manualTODOplaceholder for the Docker image link.What is the new behavior?
Create Releasebuilds and pushes the Docker image itself, in adockerjob that runs afterbuildand reuses the built war. The release notes link directly to the Docker Hub tag.Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information
One-time configuration required before the next release
Add two repository secrets (Settings → Secrets and variables → Actions):
DOCKERHUB_USERNAMEgeosolutionsit/mapstore2DOCKERHUB_TOKENThese replace the Jenkins
config.jsonfile credential (d12a6af3-…).Running the release with Docker publish
Create Releaseworkflow (as today) from the stable branch.version/previousVersionas usual.dockerTagLatest:true(default) for the newest release → also updates:latest.falsefor a patch on an older branch → publishes only:<version>, leaves:latestuntouched.Not ported from Jenkins (intentional)
docker rmi/docker image prunecleanup — GitHub runners are ephemeral.MapStore2-Stable-Releaser-EndPointTeststrigger — out of scope of image publishing.buildjob artifact instead of being rebuilt inside the docker step.