This thing is a small shell script I put together to automatically build C# projects after each and every commit made to the system.
It also provides a lightened and edited version which checks build success before making a commit.
-
Put the files
pre-commitandpost-commitinto the.git/hooksfolder of your project. -
Then, make a folder called
buildsin the project's root (where.gitis) and putAutoBuild.shinto it. -
TestBuild.shis to be put in the root of the project. -
Edit the configuration values
SOLUTION,BUILTPATHandBUILTNAMEin the two Shell scripts. (You usually only have to set the solution and filenames, the format is most of the time sufficient.)
And that's just it, the hooks are installed. Next time you run a commit, the solution will be checked, committed and then built.