I have a maven project that I build using gitlab. When a tag is created, I run 'mvn package'. This create a jar, that is then copy and launch on the server. -> All this works well.
Now I would like to add automatically in the release note, all the commits that occurs between this tag and the previous tag, so that I know what is deployed in this tag.
How I can do that during the CI ?
I made it work like this:
# create release note
- >-
curl --request POST
-H "PRIVATE-TOKEN: ${GITLABAPI_TOKEN}"
-H 'Content-Type: application/json'
--data "{\"description\": \"`git log $(git tag --sort version:refname | tail -n 2 | head -n 1)..$(git tag --sort version:refname | tail -n 1) --oneline | sed '$!s/$/<br>/' | tr -d '\n'`\"}"
https://gitlab.unc.nc/api/v4/projects/${APP_GITLAB_NUMBER}/repository/tags/${CI_COMMIT_TAG}/release
This update the release note of the tag, with all commits that occurs between the 2 last commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With