Created
October 13, 2012 15:35
-
-
Save meganehouser/3885030 to your computer and use it in GitHub Desktop.
特定の拡張子のファイルに更新があった場合にビルド要求を投げるHook
This file contains 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
# 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