For the task (details below). I made a copy of the post-update.sample file and name as post-update.
The post-update file content (details below). I executed manually to see if it will create a tag and it did. Then checkout master branch (git checkout master) and merge the feature branch (git merge feature) at the end I push all my changes (git push --all).
I get the below error and I have no idea why.
- seems like ‘post-update’ hook is not working
FAILED git_hooks.py::test_git_hooks - AssertionError: - seems like 'post-upda…
Task details
The Nautilus application development team was working on a git repository /opt/blog.git which is cloned under /usr/src/kodekloudrepos directory present on Storage server in Stratos DC. The team want to setup a hook on this repository, please find below more details:
Merge the feature branch into the master branch`, but before pushing your changes complete below point.
Create a post-update hook in this git repository so that whenever any changes are pushed to the master branch, it creates a release tag with name release-2023-06-15, where 2023-06-15 is supposed to be the current date. For example if today is 20th June, 2023 then the release tag must be release-2023-06-20. Make sure you test the hook at least once and create a release tag for today’s release.
Finally remember to push your changes.
post-update (file content)
current_date=date +"%Y-%m-%d"
release_name=“release-$current_date”
exec git tag $release_name