Skip to content

Instantly share code, notes, and snippets.

@bolasblack
Last active December 22, 2015 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bolasblack/6462220 to your computer and use it in GitHub Desktop.
Save bolasblack/6462220 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
description 'exec git push after save page'
Page.hook :after_commit do
Olelo.logger.info "push git history after save page"
git_path = Config[:repository][:git][:path]
response = `git --git-dir=#{git_path} --bare push origin master 2>&1`
if $?.success?
Olelo.logger.info "git history push success"
else
Olelo.logger.error "git history push failure, reason: #{response}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment