-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
refs :
- java :
- from the source code, to the maven artifact, and the runtime : https://dzone.com/articles/maven-git-commit-id-plugin
- from the source code, to the Dockerfile, with labels:
- extract the
git.properties
file from the jar see annex A below - inject JSON into label value https://docs.docker.com/config/labels-custom-metadata/#value-guidelines use
JSON.stringify()
to turn JSON into a string, that's it. Thenjq
will help when reading the Docker label back from the image.
- extract the
- From the Dockerfile, to the Kubernetes Cluster : the same JSON, stringified again, set as deployment label in the helm and also for API deployers, to set as API deployment metadata, so as to ... (canary, blue / green ...), with the CRD... API deployement metaData into crd what can we do with that...
- git commit id maven : what about package informations
- nodejs/typescript :
ANNEX A
# --- extract files in jar :
jar xvf /path/to/file.jar
unzip /path/to/file.jar
# --- list files in jar :
jar tvf /path/to/file.jar
unzip -l /path/to/file.jar
Ok so I :
- list files in jar, to check the
git.properties
is there, throw an error if not, - and then extract
git.properties
file , to inject the full JSON ingit.properties
, as a label value into the docker image
Now the version informations given at runtime by Gravitee must (first) be based on that git.properties file (if necessary, there will be falback method to get those version informations)
ANNEX B : git user password in git.properties
Ok beware to produce approriate configuration to make sure no secrets exposed
yet issue is foxed in git commit id plugin : git-commit-id/git-commit-id-maven-plugin#241
Metadata
Metadata
Assignees
Labels
No labels