Created
March 31, 2015 09:53
-
-
Save bernardo-cs/dc2d8c244cebab3d2b13 to your computer and use it in GitHub Desktop.
pre push git hook to build middleman release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "building latest release" | |
rake gitbuild | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :gitbuild do | |
build_status = false | |
Dir.chdir('middleman') do | |
build_status = system("middleman build") | |
end | |
if build_status | |
system("git add .") | |
system("git commit -am 'AUTO BUILD AT: #{Time.now.getutc}'") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment