Skip to content

Instantly share code, notes, and snippets.

@meganehouser
Created October 13, 2012 15:35
Show Gist options
  • Save meganehouser/3885030 to your computer and use it in GitHub Desktop.
Save meganehouser/3885030 to your computer and use it in GitHub Desktop.
特定の拡張子のファイルに更新があった場合にビルド要求を投げるHook
# coding: utf-8
from mercurial import ui, hg
# 更新があったときにビルド要求をする拡張し
EXTENSION = '.rst'
# ビルド用URL
BUILD_URL = 'http://example.jp:8080/job/job_name/build'
def build(ui, repo, **kwargs):
ctx = repo[kwargs['node']]
for filename in ctx.files():
if filename.endswith(EXTENSION):
print ('Jenkinsにビルド要求を行います。')
import urllib
urllib.urlopen(BUILD_URL)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment