Created
January 25, 2013 16:44
-
-
Save garsue/4635913 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
#vim: fileencoding=utf-8 | |
from __future__ import print_function, division, unicode_literals | |
import urllib2 | |
""" | |
Hooking git events to execute build on jenkins. | |
DON'T FORGET TO GIVE PERMISSION. | |
""" | |
try: | |
# urllib2.urlopen('http://localhost:<port>/job/<project_name>/build?delay=0sec') | |
# urllib2.urlopen('http://localhost:<port>/jenkins/job/<project_name>/build?delay=0sec') when setting prefix | |
urllib2.urlopen('http://localhost:8080/jenkins/job/GraduationThesis/build?delay=0sec') | |
except urllib2.HTTPError as e: | |
print("Reason", e.reason) | |
except urllib2.URLError as e: | |
print("Response code:", e.code) | |
print("Reason", e.reason) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment