ci: build Docker image and push to registry from applicative's CI#98
Open
bolinocroustibat wants to merge 8 commits intomainfrom
Open
ci: build Docker image and push to registry from applicative's CI#98bolinocroustibat wants to merge 8 commits intomainfrom
bolinocroustibat wants to merge 8 commits intomainfrom
Conversation
4295b82 to
1201c7a
Compare
27b2cf8 to
09da643
Compare
09da643 to
e2aca73
Compare
0159709 to
f1b2baf
Compare
e2aca73 to
50e5618
Compare
f1b2baf to
524a10b
Compare
b493cce to
5ac7859
Compare
…d on any push Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .circleci/config.yml
…h on pypo on tag # Conflicts: # .circleci/config.yml
5ac7859 to
b0e8d75
Compare
maudetes
reviewed
Feb 19, 2026
Comment on lines
+122
to
+123
| # Docker tags allow only [a-zA-Z0-9_.-]; setuptools_scm can output e.g. 0.4.0.dev5+gabc1234 | ||
| DOCKER_TAG=$(echo "$RELEASE_VERSION" | tr '+' '-') |
Contributor
There was a problem hiding this comment.
I wonder if we should use commit sha instead of a tag? I think it would be nice to have a single strategy between the different docker images naming?
| - publish: | ||
| filters: | ||
| branches: | ||
| only: << pipeline.parameters.publish-branch >> |
Contributor
There was a problem hiding this comment.
Have you tried running the pipeline by changing the filter to allow it on this branch?
This would allow testing the resulting docker image :)
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.
Closes #94.
Need the little CI simplification #97 to be merged first, and the infra workflow to be adapted (it has its own MR).
Build and push as a Docker image from applicative's CI (here, CircleCI), as we did with cdata
Changes:
APP_MODULEenv var to define if it's for Tabular API or Metrics APIbuildjob that builds the wheel and the Docker image, then pushes the image to the GitLab registry.publish-pypiruns only on version tags.mainand on version tags (v*). Docker image tag is always the package version from setuptools_scm (RELEASE_VERSION), so the wheel and the image stay in sync; no separate branch/tag logic for the image.main).Example workflow:
v1.2.0):registry.gitlab.com/etalab/data.gouv.fr/infra/tabular-api:1.2.0andregistry.gitlab.com/etalab/data.gouv.fr/infra/metrics-api:1.2.0publish-pypiruns on version tags).main(no tag):registry.gitlab.com/etalab/data.gouv.fr/infra/tabular-api:1.2.0.dev5or...:1.2.0.dev5-a1b2c3d, andregistry.gitlab.com/etalab/data.gouv.fr/infra/metrics-api:1.2.0.dev5publish-pypiruns only on version tags, not on branch pushes.Each build gets a unique image tag (no overwriting).
Follow-up
As a follow-up PR, we can also easily set up an automatic infra deployment when pushing a version tag. This would involve a
trigger-gitlab-pipeline jobto send the tag using @jordanguedj ’s scaffolding scriptIt’s not a requirement for now, unless you want to go all the way (spoiler: I’m keen, but I’ll keep it for a separate PR).