How can I enforce running grunt before git push?
I am using grunt to create production ready files from my dev files and git for source control and pushing to prod server. It works nice if a person who pushes files uses it properly (run
The problem is that sometimes people forgot and just push. This does not create errors in app per se, but does not add new functionality to the project (which creates a confusion). I am trying to find a way how can I enforce running grunt before git push. So when I just run git push, it tells me: Hey you forgot to run grunt!
Currently the only theoretical way I came up with is to have increments in prod build files and run git pre-commit hook to compare these numbers and discard commits that has the same numbers. Is there any problem with this idea? Is there a better idea?
One Solution collect form web for “How can I enforce running grunt before git push?”
We could imagine enforcing code review (using for example Gerrit): if the committer forget, the reviewer might notice it.
However, what about using another tool to push to prod? Having a deployer tool responsible for pushing from the repo to the prod servers would surely be more flexible than Git.
What about for example a Jenkins server which could run every hour (or on-demand) to fetch the git repo, run Grunt, and push on the prod server?